mirror of
https://github.com/Shopify/liquid.git
synced 2026-10-03 09:05:13 -07:00
Switch disabled? to not mutate output
This commit is contained in:
@@ -154,7 +154,10 @@ module Liquid
|
|||||||
private
|
private
|
||||||
|
|
||||||
def render_node(context, output, node)
|
def render_node(context, output, node)
|
||||||
return if node.disabled?(context, output)
|
if node.disabled?(context)
|
||||||
|
output << node.disabled_error_message
|
||||||
|
return
|
||||||
|
end
|
||||||
disable_tags(context, node.disabled_tags) do
|
disable_tags(context, node.disabled_tags) do
|
||||||
node.render_to_output_buffer(context, output)
|
node.render_to_output_buffer(context, output)
|
||||||
end
|
end
|
||||||
|
|||||||
+2
-4
@@ -46,10 +46,8 @@ module Liquid
|
|||||||
''
|
''
|
||||||
end
|
end
|
||||||
|
|
||||||
def disabled?(context, output)
|
def disabled?(context)
|
||||||
if context.registers['disabled_tags'].disabled?(tag_name)
|
context.registers['disabled_tags'].disabled?(tag_name)
|
||||||
output << disabled_error_message
|
|
||||||
end
|
|
||||||
end
|
end
|
||||||
|
|
||||||
def disabled_error_message
|
def disabled_error_message
|
||||||
|
|||||||
@@ -104,7 +104,7 @@ module Liquid
|
|||||||
output
|
output
|
||||||
end
|
end
|
||||||
|
|
||||||
def disabled?(_context, _output)
|
def disabled?(_context)
|
||||||
false
|
false
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user