don't allow invalid syntax inside comment tag

This commit is contained in:
Michael Go
2023-12-14 17:01:03 -04:00
parent c658bf970a
commit 3c5ad7db61
2 changed files with 34 additions and 20 deletions
+2 -8
View File
@@ -49,15 +49,9 @@ module Liquid
next if tag_name_match.nil?
tag_name_match[1]
elsif token =~ BlockBody::FullToken && Regexp.last_match(2) == "comment" || Regexp.last_match(2) == "endcomment"
# aggressively match comment tag or comment tag delimiter
Regexp.last_match(2)
else
tag_name_match = BlockBody::FullTokenPossiblyInvalid.match(token)
next if tag_name_match.nil?
tag_name_match[2]
token =~ BlockBody::FullToken
Regexp.last_match(2)
end
case tag_name