Skip to content

Commit

Permalink
Allow liquid tag inside liquid tag
Browse files Browse the repository at this point in the history
  • Loading branch information
Maaarcocr committed Jul 6, 2023
1 parent 546dd9b commit 10e0fb7
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 0 deletions.
3 changes: 3 additions & 0 deletions lib/liquid/block_body.rb
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,9 @@ def freeze
end
tag_name = Regexp.last_match(1)
markup = Regexp.last_match(2)
if tag_name == "liquid"
next
end
unless (tag = registered_tags[tag_name])
# end parsing if we reach an unknown tag and let the caller decide
# determine how to proceed
Expand Down
11 changes: 11 additions & 0 deletions test/integration/tags/liquid_tag_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -113,4 +113,15 @@ def test_liquid_tag_in_raw
{% raw %}{% liquid echo 'test' %}{% endraw %}
LIQUID
end

def test_nested_liquid_tags
assert_template_result('good', <<~LIQUID)
{%- liquid
liquid
if true
echo "good"
endif
-%}
LIQUID
end
end

0 comments on commit 10e0fb7

Please sign in to comment.