diff --git a/mode/javascript/javascript.js b/mode/javascript/javascript.js index 89f1220369..cf3a5f003c 100644 --- a/mode/javascript/javascript.js +++ b/mode/javascript/javascript.js @@ -402,7 +402,7 @@ CodeMirror.defineMode("javascript", function(config, parserConfig) { state.lexical.align = false; state.indented = stream.indentation(); } - if (stream.eatSpace()) return null; + if (state.tokenize != jsTokenComment && stream.eatSpace()) return null; var style = state.tokenize(stream, state); if (type == "comment") return style; state.lastType = type;