Recursively parse for liquid tag

This commit is contained in:
Marco Concetto Rudilosso
2023-07-07 11:20:34 +01:00
parent 10e0fb795e
commit 7f2cf1fe67
2 changed files with 27 additions and 2 deletions
+22
View File
@@ -124,4 +124,26 @@ class LiquidTagTest < Minitest::Test
-%}
LIQUID
end
def test_nested_liquid_tags_on_same_line
assert_template_result('good', <<~LIQUID)
{%- liquid liquid liquid echo "good" -%}
LIQUID
end
def test_nested_liquid_liquid_is_not_skipped_if_used_in_non_tag_position
assert_template_result('liquid', <<~LIQUID, { 'liquid' => 'liquid' })
{%- liquid liquid liquid echo liquid -%}
LIQUID
end
def test_next_liquid_with_unclosed_if_tag
assert_match_syntax_error("Liquid syntax error (line 2): 'if' tag was never closed", <<~LIQUID)
{%- liquid
liquid if true
echo "good"
endif
-%}
LIQUID
end
end