mirror of
https://github.com/Shopify/liquid.git
synced 2026-09-18 18:30:40 -07:00
Test disable_tags register
This commit is contained in:
+4
-2
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
|
||||
Reference in New Issue
Block a user