mirror of
https://github.com/Shopify/liquid.git
synced 2026-09-19 10:52:48 -07:00
clean up comment tag body parsing
Co-authored-by: Peter Zhu <[email protected]>
This commit is contained in:
@@ -47,16 +47,12 @@ module Liquid
|
|||||||
|
|
||||||
tag_name = tag_name_match[2]
|
tag_name = tag_name_match[2]
|
||||||
|
|
||||||
if tag_name == "raw"
|
case tag_name
|
||||||
# raw tags are required to be closed
|
when "raw"
|
||||||
parse_raw_tag_body(tokens)
|
parse_raw_tag_body(tokens)
|
||||||
next
|
when "comment"
|
||||||
end
|
|
||||||
|
|
||||||
if tag_name_match[2] == "comment"
|
|
||||||
comment_tag_depth += 1
|
comment_tag_depth += 1
|
||||||
next
|
when "endcomment"
|
||||||
elsif tag_name_match[2] == "endcomment"
|
|
||||||
comment_tag_depth -= 1
|
comment_tag_depth -= 1
|
||||||
|
|
||||||
return false if comment_tag_depth.zero?
|
return false if comment_tag_depth.zero?
|
||||||
|
|||||||
Reference in New Issue
Block a user