From 79d7dd06df99c709ac2f97f4d38472d36395a34d Mon Sep 17 00:00:00 2001 From: Gaurav Chande Date: Wed, 3 Jun 2015 19:44:52 +0000 Subject: [PATCH] Extract tag fetching into a method (which can be overriden then) --- lib/liquid/block_body.rb | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/lib/liquid/block_body.rb b/lib/liquid/block_body.rb index 66eaffa..be5b65e 100644 --- a/lib/liquid/block_body.rb +++ b/lib/liquid/block_body.rb @@ -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