mirror of
https://github.com/Shopify/liquid.git
synced 2026-09-20 11:20:41 -07:00
Make Liquid::ParseContext#tags default to Liquid::Template.tags
This commit is contained in:
@@ -45,7 +45,7 @@ module Liquid
|
|||||||
end
|
end
|
||||||
tag_name = Regexp.last_match(1)
|
tag_name = Regexp.last_match(1)
|
||||||
markup = Regexp.last_match(2)
|
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
|
# end parsing if we reach an unknown tag and let the caller decide
|
||||||
# determine how to proceed
|
# determine how to proceed
|
||||||
return yield tag_name, markup
|
return yield tag_name, markup
|
||||||
@@ -132,7 +132,7 @@ module Liquid
|
|||||||
next
|
next
|
||||||
end
|
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
|
# end parsing if we reach an unknown tag and let the caller decide
|
||||||
# determine how to proceed
|
# determine how to proceed
|
||||||
return yield tag_name, markup
|
return yield tag_name, markup
|
||||||
@@ -247,10 +247,5 @@ module Liquid
|
|||||||
def raise_missing_variable_terminator(token, parse_context)
|
def raise_missing_variable_terminator(token, parse_context)
|
||||||
BlockBody.raise_missing_variable_terminator(token, parse_context)
|
BlockBody.raise_missing_variable_terminator(token, parse_context)
|
||||||
end
|
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
|
||||||
end
|
end
|
||||||
|
|||||||
@@ -10,7 +10,7 @@ module Liquid
|
|||||||
|
|
||||||
@locale = @template_options[:locale] ||= I18n.new
|
@locale = @template_options[:locale] ||= I18n.new
|
||||||
@warnings = []
|
@warnings = []
|
||||||
@tags = @template_options[:tags]
|
@tags = @template_options[:tags] || Liquid::Template.tags
|
||||||
|
|
||||||
self.depth = 0
|
self.depth = 0
|
||||||
self.partial = false
|
self.partial = false
|
||||||
|
|||||||
Reference in New Issue
Block a user