mirror of
https://github.com/Shopify/liquid.git
synced 2026-09-20 11:20:41 -07:00
Extract tag fetching into a method (which can be overriden then)
This commit is contained in:
@@ -22,7 +22,7 @@ module Liquid
|
|||||||
tag_name = $1
|
tag_name = $1
|
||||||
markup = $2
|
markup = $2
|
||||||
# fetch the tag from registered blocks
|
# fetch the tag from registered blocks
|
||||||
if tag = Template.tags[tag_name]
|
if tag = registered_tags[tag_name]
|
||||||
markup = token.child(markup) if token.is_a?(Token)
|
markup = token.child(markup) if token.is_a?(Token)
|
||||||
new_tag = tag.parse(tag_name, markup, tokens, options)
|
new_tag = tag.parse(tag_name, markup, tokens, options)
|
||||||
new_tag.line_number = token.line_number if token.is_a?(Token)
|
new_tag.line_number = token.line_number if token.is_a?(Token)
|
||||||
@@ -127,5 +127,9 @@ module Liquid
|
|||||||
def raise_missing_variable_terminator(token, options)
|
def raise_missing_variable_terminator(token, options)
|
||||||
raise SyntaxError.new(options[:locale].t("errors.syntax.variable_termination".freeze, token: token, tag_end: VariableEnd.inspect))
|
raise SyntaxError.new(options[:locale].t("errors.syntax.variable_termination".freeze, token: token, tag_end: VariableEnd.inspect))
|
||||||
end
|
end
|
||||||
|
|
||||||
|
def registered_tags
|
||||||
|
Template.tags
|
||||||
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|||||||
Reference in New Issue
Block a user