Make Liquid::ParseContext#tags default to Liquid::Template.tags

This commit is contained in:
Dylan Thacker-Smith
2022-09-29 10:31:39 -04:00
parent 6bdf88a32c
commit 6509aa57e3
2 changed files with 3 additions and 8 deletions
+2 -7
View File
@@ -45,7 +45,7 @@ module Liquid
end
tag_name = Regexp.last_match(1)
markup = Regexp.last_match(2)
unless (tag = registered_tag(tag_name, parse_context))
unless (tag = parse_context.tags[tag_name])
# end parsing if we reach an unknown tag and let the caller decide
# determine how to proceed
return yield tag_name, markup
@@ -132,7 +132,7 @@ module Liquid
next
end
unless (tag = registered_tag(tag_name, parse_context))
unless (tag = parse_context.tags[tag_name])
# end parsing if we reach an unknown tag and let the caller decide
# determine how to proceed
return yield tag_name, markup
@@ -247,10 +247,5 @@ module Liquid
def raise_missing_variable_terminator(token, parse_context)
BlockBody.raise_missing_variable_terminator(token, parse_context)
end
def registered_tag(tag_name, parse_context)
context_tag = parse_context.tags[tag_name] if parse_context.tags.respond_to?(:[])
context_tag || Template.tags[tag_name]
end
end
end
+1 -1
View File
@@ -10,7 +10,7 @@ module Liquid
@locale = @template_options[:locale] ||= I18n.new
@warnings = []
@tags = @template_options[:tags]
@tags = @template_options[:tags] || Liquid::Template.tags
self.depth = 0
self.partial = false