diff --git a/lib/liquid/block_body.rb b/lib/liquid/block_body.rb index 4674c5f3..42d372bb 100644 --- a/lib/liquid/block_body.rb +++ b/lib/liquid/block_body.rb @@ -45,6 +45,9 @@ module Liquid 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 diff --git a/test/integration/tags/liquid_tag_test.rb b/test/integration/tags/liquid_tag_test.rb index 17ce0019..d10c49a6 100644 --- a/test/integration/tags/liquid_tag_test.rb +++ b/test/integration/tags/liquid_tag_test.rb @@ -113,4 +113,15 @@ class LiquidTagTest < Minitest::Test {% 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