Skip to content

Commit de02dd6

Browse files
charlespwdclaude
andcommitted
Derive block_form? from @Body presence instead of tracking separately
@Body is only set in reparent_as_block, so it already encodes whether the tag is in block form. Remove the redundant @block_form flag. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
1 parent afed2f2 commit de02dd6

1 file changed

Lines changed: 2 additions & 4 deletions

File tree

lib/liquid/hybrid_tag.rb

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,18 +3,16 @@
33
module Liquid
44
class HybridTag < Block
55
def reparent_as_block(children, parse_context)
6-
@block_form = true
76
@body = new_body
87
@body.nodelist.concat(children)
98
@body.freeze
109
end
1110

1211
def parse(_tokens)
13-
@block_form = false
1412
end
1513

1614
def block_form?
17-
@block_form
15+
!!@body
1816
end
1917

2018
def nodelist
@@ -26,7 +24,7 @@ def blank?
2624
end
2725

2826
def render_to_output_buffer(context, output)
29-
if @block_form
27+
if block_form?
3028
render_block_form_to_output_buffer(context, output)
3129
else
3230
render_self_closing_to_output_buffer(context, output)

0 commit comments

Comments
 (0)