mirror of
https://github.com/Shopify/liquid.git
synced 2026-09-12 23:40:45 -07:00
Clean up whitespace collapsing a bit
This commit is contained in:
+3
-4
@@ -7,8 +7,8 @@ module Liquid
|
||||
FullToken = /^#{TagStart}\s*(\w+)\s*(.*)?#{TagEnd}$/o
|
||||
ContentOfVariable = /^#{VariableStart}(.*)#{VariableEnd}$/o
|
||||
|
||||
def self.blank?
|
||||
false
|
||||
def blank?
|
||||
@blank || false
|
||||
end
|
||||
|
||||
def parse(tokens)
|
||||
@@ -25,14 +25,13 @@ module Liquid
|
||||
# proceed
|
||||
if block_delimiter == $1
|
||||
end_tag
|
||||
@blank = true if self.class.blank?
|
||||
return
|
||||
end
|
||||
|
||||
# fetch the tag from registered blocks
|
||||
if tag = Template.tags[$1]
|
||||
new_tag = tag.new($1, $2, tokens)
|
||||
@blank = false if new_tag.is_a?(Block) && !new_tag.blank
|
||||
@blank = false unless new_tag.blank?
|
||||
@nodelist << new_tag
|
||||
else
|
||||
# this tag is not registered with the system
|
||||
|
||||
+2
-2
@@ -19,8 +19,8 @@ module Liquid
|
||||
''
|
||||
end
|
||||
|
||||
def self.blank?
|
||||
true
|
||||
def blank?
|
||||
@blank || true
|
||||
end
|
||||
end # Tag
|
||||
end # Tag
|
||||
|
||||
@@ -31,7 +31,7 @@ module Liquid
|
||||
''
|
||||
end
|
||||
|
||||
def self.blank?
|
||||
def blank?
|
||||
true
|
||||
end
|
||||
end
|
||||
|
||||
@@ -4,7 +4,7 @@ module Liquid
|
||||
''
|
||||
end
|
||||
|
||||
def self.blank?
|
||||
def blank?
|
||||
true
|
||||
end
|
||||
end
|
||||
|
||||
@@ -28,7 +28,9 @@ module Liquid
|
||||
value.to_s
|
||||
end
|
||||
|
||||
private
|
||||
def blank?
|
||||
false
|
||||
end
|
||||
end
|
||||
|
||||
Template.register_tag('increment', Increment)
|
||||
|
||||
Reference in New Issue
Block a user