Test disable_tags register

This commit is contained in:
Mike Angell
2019-09-23 22:02:13 +10:00
parent fc4059c8dd
commit 4202976d79
4 changed files with 59 additions and 3 deletions
+4 -2
View File
@@ -38,8 +38,10 @@ module Liquid
''
end
def disabled?(context)
context.registers['disabled_tags']&.disabled?(tag_name)
def disabled?(context, output)
if context.registers['disabled_tags']&.disabled?(tag_name)
output << disabled_response
end
end
def disabled_response
+1 -1
View File
@@ -45,7 +45,7 @@ module Liquid
end
def render_to_output_buffer(context, output)
return output << disabled_response if disabled?(context)
disabled?(context, output) && return
template_name = context.evaluate(@template_name_expr)
raise ArgumentError, options[:locale].t("errors.argument.include") unless template_name