panoply / vscode-liquid

💧Liquid language support for VS Code
https://marketplace.visualstudio.com/items?itemName=sissel.shopify-liquid
Other
173 stars 22 forks source link

Comment in Liquid tag inside HTML attribute breaks syntax highlighting #147

Closed sentience closed 12 months ago

sentience commented 1 year ago

This code incorrectly renders the closing %} of the comment tag in the comment style, and breaks HTML syntax highlighting in the rest of the file:

  <div
    class="
      page-inset-padding flex
      {% # arrow overlaps preceding margin %}
      -mbs-4 pbs-4
    "
  >

Partial work-around: Removing the space after the # keeps the syntax highlighting in the rest of the file working, but does not highlight the comment as a comment:

  <div
    class="
      page-inset-padding flex
      {% #arrow overlaps preceding margin %}
      -mbs-4 pbs-4
    "
  >
panoply commented 1 year ago

@sentience Interesting structure.

I can likely augment the grammar injection for value highlighting. Good catch and thanks for reporting these issues, it is a huge help and greatly appreciated.