diff --git a/lib/liquid/tags/comment.rb b/lib/liquid/tags/comment.rb index b60ef01b6..5c7315e0e 100644 --- a/lib/liquid/tags/comment.rb +++ b/lib/liquid/tags/comment.rb @@ -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?