Syntax highlighting issue with inline Liquid comments

When using the lang-markdown and lang-liquid extensions, I’m having an issue with the color syntax when I have an inline comment followed by a heading:

{% # here is a comment %}
# Heading

It ends up rendering the # Heading line as a comment:

image

When I put the %} on a new line, the issue goes away.

I believe the issue with the parser is that it should be seeing %} as an ending statement, even though it’s on the same line as the #.

According to the docs, this should be valid syntax:

{% # content %}

So it should stop parsing on the %} token.

Is there a way to fix this behavior?

Are you using an older version of @codemirror/lang-liquid? This should be fixed in 6.2.3 from March.

I was using 6.2.2 and updating to 6.2.3 resolved the issue!

Thanks for such a quick response and resolution!