Skip to content

Commit 84a02bc

Browse files
committed
[javascript mode] Reduce start-of-line restriction to HTML close comment tokens
Issue codemirror#6305
1 parent b074875 commit 84a02bc

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

mode/javascript/javascript.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -103,8 +103,8 @@ CodeMirror.defineMode("javascript", function(config, parserConfig) {
103103
return ret("meta", "meta");
104104
} else if (ch == "#" && stream.eatWhile(wordRE)) {
105105
return ret("variable", "property")
106-
} else if ((ch == "<" && stream.match("!--") || ch == "-" && stream.match("->")) &&
107-
!/\S/.test(stream.string.slice(0, stream.start))) {
106+
} else if (ch == "<" && stream.match("!--") ||
107+
(ch == "-" && stream.match("->") && !/\S/.test(stream.string.slice(0, stream.start)))) {
108108
stream.skipToEnd()
109109
return ret("comment", "comment")
110110
} else if (isOperatorChar.test(ch)) {

0 commit comments

Comments
 (0)