Skip to content

Commit

Permalink
clean up comment tag body parsing
Browse files Browse the repository at this point in the history
Co-authored-by: Peter Zhu <peter@peterzhu.ca>
  • Loading branch information
ggmichaelgo and peterzhu2118 authored Nov 8, 2023
1 parent dbf0aa8 commit eada2b6
Showing 1 changed file with 4 additions and 8 deletions.
12 changes: 4 additions & 8 deletions lib/liquid/tags/comment.rb
Original file line number Diff line number Diff line change
Expand Up @@ -47,16 +47,12 @@ def parse_body(body, tokens)

tag_name = tag_name_match[2]

if tag_name == "raw"
# raw tags are required to be closed
case tag_name
when "raw"
parse_raw_tag_body(tokens)
next
end

if tag_name_match[2] == "comment"
when "comment"
comment_tag_depth += 1
next
elsif tag_name_match[2] == "endcomment"
when "endcomment"
comment_tag_depth -= 1

return false if comment_tag_depth.zero?
Expand Down

0 comments on commit eada2b6

Please sign in to comment.