Skip to content

Commit

Permalink
Fix tags in comment
Browse files Browse the repository at this point in the history
  • Loading branch information
peterzhu2118 committed Nov 6, 2020
1 parent c7c21e8 commit 8ecdc0f
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
2 changes: 1 addition & 1 deletion lib/liquid/block_body.rb
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
module Liquid
class BlockBody
LiquidTagToken = /\A\s*(\w+)\s*(.*?)\z/o
FullToken = /\A#{TagStart}#{WhitespaceControl}?(\s*)(\w+)(\s*)(.*?)#{WhitespaceControl}?#{TagEnd}\z/om
FullToken = /\A#{TagStart}#{WhitespaceControl}?(\s*)(\S*)(\s*)(.*?)#{WhitespaceControl}?#{TagEnd}\z/om
ContentOfVariable = /\A#{VariableStart}#{WhitespaceControl}?(.*?)#{WhitespaceControl}?#{VariableEnd}\z/om
WhitespaceOrNothing = /\A\s*\z/
TAGSTART = "{%"
Expand Down
2 changes: 2 additions & 0 deletions test/integration/tags/standard_tag_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,8 @@ def test_has_a_block_which_does_nothing
assert_template_result('', '{%comment%}{% endif %}{%endcomment%}')
assert_template_result('', '{% comment %}{% endwhatever %}{% endcomment %}')
assert_template_result('', '{% comment %}{% raw %} {{%%%%}} }} { {% endcomment %} {% comment {% endraw %} {% endcomment %}')
assert_template_result('', '{% comment %}{% " %}{% endcomment %}')
assert_template_result('', '{% comment %}{%%}{% endcomment %}')

assert_template_result('foobar', 'foo{%comment%}comment{%endcomment%}bar')
assert_template_result('foobar', 'foo{% comment %}comment{% endcomment %}bar')
Expand Down

0 comments on commit 8ecdc0f

Please sign in to comment.