diff --git a/lib/liquid/block_body.rb b/lib/liquid/block_body.rb index 6022324c..2b4855da 100644 --- a/lib/liquid/block_body.rb +++ b/lib/liquid/block_body.rb @@ -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 diff --git a/lib/liquid/parse_context.rb b/lib/liquid/parse_context.rb index afd4ea53..efb1aa97 100644 --- a/lib/liquid/parse_context.rb +++ b/lib/liquid/parse_context.rb @@ -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