mirror of
https://github.com/Shopify/liquid.git
synced 2026-10-04 01:25:14 -07:00
Shuffle logic around.
This commit is contained in:
+1
-3
@@ -28,9 +28,7 @@ module Liquid
|
|||||||
|
|
||||||
# fetch the tag from registered blocks
|
# fetch the tag from registered blocks
|
||||||
if tag = Template.tags[$1]
|
if tag = Template.tags[$1]
|
||||||
new_tag = tag.allocate
|
new_tag = tag.new_with_options($1, $2, tokens, @options || {})
|
||||||
new_tag.options = @options || {}
|
|
||||||
new_tag.send(:initialize, $1, $2, tokens)
|
|
||||||
@blank &&= new_tag.blank?
|
@blank &&= new_tag.blank?
|
||||||
@nodelist << new_tag
|
@nodelist << new_tag
|
||||||
else
|
else
|
||||||
|
|||||||
@@ -2,6 +2,13 @@ module Liquid
|
|||||||
class Tag
|
class Tag
|
||||||
attr_accessor :nodelist, :options
|
attr_accessor :nodelist, :options
|
||||||
|
|
||||||
|
def self.new_with_options(tag_name, markup, tokens, options)
|
||||||
|
new_tag = self.allocate
|
||||||
|
new_tag.options = options
|
||||||
|
new_tag.send(:initialize, tag_name, markup, tokens)
|
||||||
|
new_tag
|
||||||
|
end
|
||||||
|
|
||||||
def initialize(tag_name, markup, tokens)
|
def initialize(tag_name, markup, tokens)
|
||||||
@tag_name = tag_name
|
@tag_name = tag_name
|
||||||
@markup = markup
|
@markup = markup
|
||||||
|
|||||||
Reference in New Issue
Block a user