Switch disabled? to not mutate output

This commit is contained in:
Mike Angell
2019-09-25 23:57:55 +10:00
parent 644de4c4f5
commit 68abd9c135
3 changed files with 7 additions and 6 deletions
+4 -1
View File
@@ -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
View File
@@ -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
+1 -1
View File
@@ -104,7 +104,7 @@ module Liquid
output
end
def disabled?(_context, _output)
def disabled?(_context)
false
end