Extract tag fetching into a method (which can be overriden then)

This commit is contained in:
Gaurav Chande
2015-06-03 19:44:52 +00:00
parent 3a907a4db7
commit 79d7dd06df

View File

@@ -22,7 +22,7 @@ module Liquid
tag_name = $1
markup = $2
# 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)
new_tag = tag.parse(tag_name, markup, tokens, options)
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)
raise SyntaxError.new(options[:locale].t("errors.syntax.variable_termination".freeze, token: token, tag_end: VariableEnd.inspect))
end
def registered_tags
Template.tags
end
end
end