mirror of
https://github.com/Shopify/liquid.git
synced 2026-09-15 17:00:39 -07:00
Make Liquid::ParseContext#tags default to Liquid::Template.tags
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user