fix parsing comment tag delimiter

This commit is contained in:
Michael Go
2023-11-30 13:24:54 -04:00
parent cf2787791e
commit bf0f79f36c
2 changed files with 21 additions and 1 deletions
+20
View File
@@ -135,4 +135,24 @@ class CommentTagUnitTest < Minitest::Test
LIQUID
)
end
def test_ignores_delimiter_with_extra_strings
assert_template_result(
'',
<<~LIQUID.chomp,
{% if true %}
{% comment %}
{% commentXXXXX %}wut{% endcommentXXXXX %}
{% endcomment %}
{% endif %}
LIQUID
)
end
def test_delimiter_can_have_extra_strings
assert_template_result('', "{% comment %}123{% endcomment xyz %}")
assert_template_result('', "{% comment %}123{% endcomment\txyz %}")
assert_template_result('', "{% comment %}123{% endcomment\nxyz %}")
assert_template_result('', "{% comment %}123{% endcomment\n xyz endcomment %}")
end
end