mirror of
https://github.com/Shopify/liquid.git
synced 2026-09-12 23:40:45 -07:00
Fix Doc tag blank? method to check body content
Previously the blank? method always returned true. Now it properly checks if the body is empty, making the tag behavior consistent with other tags. Also updated test to use whitespace control for cleaner assertions.
This commit is contained in:
@@ -59,7 +59,7 @@ module Liquid
|
||||
end
|
||||
|
||||
def blank?
|
||||
true
|
||||
@body.empty?
|
||||
end
|
||||
|
||||
def nodelist
|
||||
|
||||
@@ -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 %}")
|
||||
|
||||
Reference in New Issue
Block a user