Skip to content

Commit

Permalink
[javascript mode] Add support for HTML-style comments
Browse files Browse the repository at this point in the history
  • Loading branch information
marijnh authored and cone56 committed Jan 6, 2020
1 parent 87631d5 commit 7a4d280
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions mode/javascript/javascript.js
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,9 @@ CodeMirror.defineMode("javascript", function(config, parserConfig) {
} else if (ch == "#") {
stream.skipToEnd();
return ret("error", "error");
} else if (ch == "<" && stream.match("!--") || ch == "-" && stream.match("->")) {
stream.skipToEnd()
return ret("comment", "comment")
} else if (isOperatorChar.test(ch)) {
if (ch != ">" || !state.lexical || state.lexical.type != ">") {
if (stream.eat("=")) {
Expand Down

0 comments on commit 7a4d280

Please sign in to comment.