mirror of
https://github.com/Shopify/liquid.git
synced 2026-09-12 23:40:45 -07:00
Fix broken 'raw' tag parsing (issue #204)
This commit is contained in:
@@ -1,12 +1,14 @@
|
||||
module Liquid
|
||||
class Raw < Block
|
||||
FullTokenPossiblyInvalid = /^(.*)#{TagStart}\s*(\w+)\s*(.*)?#{TagEnd}$/o
|
||||
|
||||
def parse(tokens)
|
||||
@nodelist ||= []
|
||||
@nodelist.clear
|
||||
|
||||
while token = tokens.shift
|
||||
if token =~ FullToken
|
||||
if block_delimiter == $1
|
||||
if token =~ FullTokenPossiblyInvalid
|
||||
@nodelist << $1 if $1 != ""
|
||||
if block_delimiter == $2
|
||||
end_tag
|
||||
return
|
||||
end
|
||||
@@ -18,4 +20,3 @@ module Liquid
|
||||
|
||||
Template.register_tag('raw', Raw)
|
||||
end
|
||||
|
||||
|
||||
Reference in New Issue
Block a user