Skip to content

Commit 9b5f1c4

Browse files
committed
[javascript mode] Add support for HTML-style comments
Closes #5988
1 parent f826bb0 commit 9b5f1c4

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

mode/javascript/javascript.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -101,6 +101,9 @@ CodeMirror.defineMode("javascript", function(config, parserConfig) {
101101
} else if (ch == "#") {
102102
stream.skipToEnd();
103103
return ret("error", "error");
104+
} else if (ch == "<" && stream.match("!--") || ch == "-" && stream.match("->")) {
105+
stream.skipToEnd()
106+
return ret("comment", "comment")
104107
} else if (isOperatorChar.test(ch)) {
105108
if (ch != ">" || !state.lexical || state.lexical.type != ">") {
106109
if (stream.eat("=")) {

0 commit comments

Comments
 (0)