Skip to content

Commit

Permalink
Fix comment blocks in extended liquid tags
Browse files Browse the repository at this point in the history
Fixes #11
  • Loading branch information
deathaxe committed Mar 15, 2024
1 parent 3e8bd64 commit 3e0c30f
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 0 deletions.
12 changes: 12 additions & 0 deletions Syntaxes/Liquid.sublime-syntax
Original file line number Diff line number Diff line change
Expand Up @@ -162,6 +162,7 @@ contexts:

liquid-statement-tag-body:
- include: jekyll-links
- include: liquid-block-comments
- include: liquid-line-comments
- include: liquid-assignments
- include: liquid-conditionals
Expand Down Expand Up @@ -220,6 +221,17 @@ contexts:

###[ LIQUID COMMENTS ]########################################################

liquid-block-comments:
- match: \bcomment\b
scope: keyword.declaration.comment.liquid
push: liquid-block-comment-body

liquid-block-comment-body:
- meta_content_scope: comment.block.liquid
- match: \bendcomment\b
scope: keyword.declaration.comment.liquid
pop: 1

liquid-line-comments:
- match: \#+
scope: punctuation.definition.comment.liquid
Expand Down
11 changes: 11 additions & 0 deletions tests/syntax_test_liquid.liquid.html
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,17 @@
| ^ punctuation.definition.comment.liquid
%}


{% liquid

comment
| ^^^^^^^ meta.statement.liquid keyword.declaration.comment.liquid - comment
commented text
| ^^^^^^^^^^^^^^^ comment.block.liquid
endcomment
| ^^^^^^^^^^ meta.statement.liquid keyword.declaration.comment.liquid - comment
%}

{% if true %}
| <- meta.embedded.liquid source.liquid meta.statement.liquid punctuation.section.embedded.begin.liquid
|^^^^^^^^^^^^ meta.embedded.liquid source.liquid meta.statement.liquid
Expand Down

0 comments on commit 3e0c30f

Please sign in to comment.