Use Tag#raw as the fallback for #format

This commit is contained in:
Justin Li
2015-05-12 13:22:58 -04:00
parent 4a17d1a4ad
commit d2cbc5610e
2 changed files with 6 additions and 7 deletions
+1 -1
View File
@@ -58,7 +58,7 @@ module Liquid
end
def format
"{% #{block_name} %}#{@body.format}{% #{block_delimiter} %}"
"{% #{raw} %}#{@body.format}{% #{block_delimiter} %}"
end
protected
+5 -6
View File
@@ -24,7 +24,10 @@ module Liquid
end
def raw
"#{@tag_name} #{@markup}"
tag = @tag_name.strip
markup = @markup.strip
tag << " #{markup}" unless markup.empty?
tag
end
def name
@@ -40,11 +43,7 @@ module Liquid
end
def format
tag = @tag_name.strip
markup = @markup.strip
tag << " #{markup}" unless markup.empty?
"{% #{tag} %}"
"{% #{raw} %}"
end
end
end