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