Clean up whitespace collapsing a bit

This commit is contained in:
Florian Weingarten
2013-06-27 13:57:26 +02:00
parent f01d0dbea6
commit c16697746b
6 changed files with 14 additions and 9 deletions
+3 -4
View File
@@ -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
View File
@@ -19,8 +19,8 @@ module Liquid
''
end
def self.blank?
true
def blank?
@blank || true
end
end # Tag
end # Tag
+1 -1
View File
@@ -31,7 +31,7 @@ module Liquid
''
end
def self.blank?
def blank?
true
end
end
+1 -1
View File
@@ -4,7 +4,7 @@ module Liquid
''
end
def self.blank?
def blank?
true
end
end
+3 -1
View File
@@ -28,7 +28,9 @@ module Liquid
value.to_s
end
private
def blank?
false
end
end
Template.register_tag('increment', Increment)