diff --git a/lib/liquid/tags/doc.rb b/lib/liquid/tags/doc.rb index b61d7e95..499102d7 100644 --- a/lib/liquid/tags/doc.rb +++ b/lib/liquid/tags/doc.rb @@ -59,7 +59,7 @@ module Liquid end def blank? - true + @body.empty? end def nodelist diff --git a/test/unit/tags/doc_tag_unit_test.rb b/test/unit/tags/doc_tag_unit_test.rb index 7c6ef6f3..64b950b7 100644 --- a/test/unit/tags/doc_tag_unit_test.rb +++ b/test/unit/tags/doc_tag_unit_test.rb @@ -174,11 +174,11 @@ class DocTagUnitTest < Minitest::Test def test_doc_tag_delimiter_handling assert_template_result('', <<~LIQUID.chomp) - {% if true %} - {% doc %} - {% docEXTRA %}wut{% enddocEXTRA %}xyz - {% enddoc %} - {% endif %} + {%- if true -%} + {%- doc -%} + {%- docEXTRA -%}wut{% enddocEXTRA -%}xyz + {%- enddoc -%} + {%- endif -%} LIQUID assert_template_result('', "{% doc %}123{% enddoc xyz %}")