Add raw tag. Fixes #37.

Thanks to phaer: https://gist.github.com/1020852

YO DAWG, WE HEARD YOU LIKE LIQUID

SO WE PUT A RAW TAG IN YOUR LIQUID
SO YOU CAN HAVE LIQUID IN YOUR LIQUID
This commit is contained in:
Jonathan Rudenberg
2011-06-12 11:15:16 -04:00
parent 1a4ff9547a
commit 4087a94d88
2 changed files with 36 additions and 0 deletions
+21
View File
@@ -0,0 +1,21 @@
module Liquid
class Raw < Block
def parse(tokens)
@nodelist ||= []
@nodelist.clear
while token = tokens.shift
if token =~ FullToken
if block_delimiter == $1
end_tag
return
end
end
@nodelist << token if not token.empty?
end
end
end
Template.register_tag('raw', Raw)
end