Skip to content

Commit a8cd634

Browse files
committed
Revert "fix(bash): Comments false positives (highlightjs#3918)"
This reverts commit d78749a.
1 parent 01df375 commit a8cd634

File tree

4 files changed

+8
-19
lines changed

4 files changed

+8
-19
lines changed

CHANGES.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -142,6 +142,7 @@ Core Grammars:
142142
- fix(rust) fix for r# raw identifier not being highlighted correctly. [JaeBaek Lee][]
143143
- enh(rust) Adding union to be recognized as a keyword in Rust. [JaeBaek Lee][]
144144
- fix(yaml) fix for yaml with keys having brackets highlighted incorrectly [Aneesh Kulkarni][]
145+
<<<<<<< HEAD
145146
- fix(csharp) add raw string highlighting for C# 11. [Tara][]
146147
- fix(bash) fix # within token being detected as the start of a comment [Felix Uhl][]
147148
- fix(python) fix `or` conflicts with string highlighting [Mohamed Ali][]
@@ -178,6 +179,8 @@ New Grammars:
178179
- added 3rd party Phix grammar to SUPPORTED_LANGUAGES [PeteLomax][]
179180
- added 3rd party Mirth grammar to SUPPORTED_LANGUAGES [Sierra][]
180181
- added 3rd party JSONata grammar to SUPPORTED_LANGUAGES [Vlad Dimov][]
182+
=======
183+
>>>>>>> parent of d78749a5 (fix(bash): Comments false positives (#3918))
181184
182185
Developer Tool:
183186

@@ -202,6 +205,7 @@ Themes:
202205
[Kristian Ekenes]: https://github.com/ekenes
203206
[Aneesh Kulkarni]: https://github.com/aneesh98
204207
[Bruno Meneguele]: https://github.com/bmeneg
208+
<<<<<<< HEAD
205209
[Tara]: https://github.com/taralei
206210
[Felix Uhl]: https://github.com/iFreilicht
207211
[nataliia-radina]: https://github.com/Nataliia-Radina
@@ -228,6 +232,9 @@ Themes:
228232
[Sierra]: https://github.com/casuallyblue
229233
[Vlad Dimov]: https://github.com/DevDimov
230234
[Chiel van de Steeg]: https://github.com/cvdsteeg
235+
=======
236+
237+
>>>>>>> parent of d78749a5 (fix(bash): Comments false positives (#3918))
231238
232239
## Version 11.9.0
233240

src/languages/bash.js

Lines changed: 1 addition & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -38,18 +38,6 @@ export default function(hljs) {
3838
end: /\)/,
3939
contains: [ hljs.BACKSLASH_ESCAPE ]
4040
};
41-
const COMMENT = hljs.inherit(
42-
hljs.COMMENT(),
43-
{
44-
match: [
45-
/(^|\s)/,
46-
/#.*$/
47-
],
48-
scope: {
49-
2: 'comment'
50-
}
51-
}
52-
);
5341
const HERE_DOC = {
5442
begin: /<<-?\s*(?=\w+)/,
5543
starts: { contains: [
@@ -394,7 +382,7 @@ export default function(hljs) {
394382
hljs.SHEBANG(), // to catch unknown shells but still highlight the shebang
395383
FUNCTION,
396384
ARITHMETIC,
397-
COMMENT,
385+
hljs.HASH_COMMENT_MODE,
398386
HERE_DOC,
399387
PATH_MODE,
400388
QUOTE_STRING,

test/markup/bash/not-comments.expect.txt

Lines changed: 0 additions & 3 deletions
This file was deleted.

test/markup/bash/not-comments.txt

Lines changed: 0 additions & 3 deletions
This file was deleted.

0 commit comments

Comments
 (0)