The following highlights somewhat correctly (ignoring the bad highlighting of the first style's content):
html
head
style(type='text/css').
div { foo bar; }
style(type='text/css')
include markdown.css
However in this case, syntax highlighting is broken for the rest of the file:
html
head
style(type='text/css').
div { foo: bar;
style(type='text/css')
include markdown.css
body
+content()
The problem is that you're allowing the patterns for the embedded grammar to consume past the end of the style block's contents, which is illegal in jade.
You need to mark that the content of the style (i.e. the lines between the style. and the next line that is less-indented than the style.) is source.cssfirst, and then match css grammar inside of it.
Because while the second example contains embedded invalid css, it's valid jade itself.
The following highlights somewhat correctly (ignoring the bad highlighting of the first
style
's content):However in this case, syntax highlighting is broken for the rest of the file:
The problem is that you're allowing the patterns for the embedded grammar to consume past the end of the style block's contents, which is illegal in jade.
You need to mark that the content of the
style
(i.e. the lines between thestyle.
and the next line that is less-indented than thestyle.
) issource.css
first, and then match css grammar inside of it.Because while the second example contains embedded invalid
css
, it's valid jade itself.