implement whitespace control to comment tag

This commit is contained in:
Michael Go
2023-12-01 16:04:03 -04:00
parent bf0f79f36c
commit 24d461a9e3
2 changed files with 15 additions and 1 deletions
+11
View File
@@ -155,4 +155,15 @@ class CommentTagUnitTest < Minitest::Test
assert_template_result('', "{% comment %}123{% endcomment\nxyz %}")
assert_template_result('', "{% comment %}123{% endcomment\n xyz endcomment %}")
end
def test_with_whitespace_control
assert_template_result("Hello!", " {%- comment -%}123{%- endcomment -%}Hello!")
assert_template_result("Hello!", "{%- comment -%}123{%- endcomment -%} Hello!")
assert_template_result("Hello!", " {%- comment -%}123{%- endcomment -%} Hello!")
assert_template_result("Hello!", <<~LIQUID.chomp)
{%- comment %}Whitespace control!{% endcomment -%}
Hello!
LIQUID
end
end