mirror of
https://github.com/Shopify/liquid.git
synced 2026-09-26 13:45:13 -07:00
Move the parse method out of Tag, only blocks need the body parsed.
The parse method should be renamed to something like parse_body, since that is how it is used, and no non-block tags were using the parse method.
This commit is contained in:
@@ -5,6 +5,11 @@ module Liquid
|
|||||||
FullToken = /\A#{TagStart}\s*(\w+)\s*(.*)?#{TagEnd}\z/o
|
FullToken = /\A#{TagStart}\s*(\w+)\s*(.*)?#{TagEnd}\z/o
|
||||||
ContentOfVariable = /\A#{VariableStart}(.*)#{VariableEnd}\z/o
|
ContentOfVariable = /\A#{VariableStart}(.*)#{VariableEnd}\z/o
|
||||||
|
|
||||||
|
def initialize(tag_name, markup, tokens)
|
||||||
|
super
|
||||||
|
parse(tokens)
|
||||||
|
end
|
||||||
|
|
||||||
def blank?
|
def blank?
|
||||||
@blank || false
|
@blank || false
|
||||||
end
|
end
|
||||||
|
|||||||
@@ -16,10 +16,6 @@ module Liquid
|
|||||||
@tag_name = tag_name
|
@tag_name = tag_name
|
||||||
@markup = markup
|
@markup = markup
|
||||||
@options ||= {} # needs || because might be set before initialize
|
@options ||= {} # needs || because might be set before initialize
|
||||||
parse(tokens)
|
|
||||||
end
|
|
||||||
|
|
||||||
def parse(tokens)
|
|
||||||
end
|
end
|
||||||
|
|
||||||
def name
|
def name
|
||||||
|
|||||||
@@ -35,9 +35,6 @@ module Liquid
|
|||||||
super
|
super
|
||||||
end
|
end
|
||||||
|
|
||||||
def parse(tokens)
|
|
||||||
end
|
|
||||||
|
|
||||||
def blank?
|
def blank?
|
||||||
false
|
false
|
||||||
end
|
end
|
||||||
|
|||||||
Reference in New Issue
Block a user