Skip to content

Commit 6e44a51

Browse files
committed
[css mode] Don't feed comment tokens to the state machine
Closes codemirror#4892
1 parent 4c3d3c7 commit 6e44a51

2 files changed

Lines changed: 8 additions & 1 deletion

File tree

mode/css/css.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -383,7 +383,8 @@ CodeMirror.defineMode("css", function(config, parserConfig) {
383383
style = style[0];
384384
}
385385
override = style;
386-
state.state = states[state.state](type, stream, state);
386+
if (type != "comment")
387+
state.state = states[state.state](type, stream, state);
387388
return override;
388389
},
389390

mode/css/test.js

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -197,4 +197,10 @@
197197

198198
MT("counter-style-symbols",
199199
"[tag ol] { [property list-style]: [atom symbols]([atom cyclic] [string \"*\"] [string \"\\2020\"] [string \"\\2021\"] [string \"\\A7\"]); }");
200+
201+
MT("comment-does-not-disrupt",
202+
"[def @font-face] [comment /* foo */] {",
203+
" [property src]: [atom url]([string x]);",
204+
" [property font-family]: [variable One];",
205+
"}")
200206
})();

0 commit comments

Comments
 (0)