Skip to content

Commit

Permalink
Address comments
Browse files Browse the repository at this point in the history
  • Loading branch information
peterzhu2118 committed Nov 9, 2020
1 parent d1a08ea commit 2c0c672
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions lib/liquid/block_body.rb
Expand Up @@ -107,14 +107,22 @@ def self.rescue_render_node(context, output, line_number, exc, blank_tag)
end
end

private def parse_for_document(tokenizer, parse_context)
private def handle_invalid_tag_token(token, parse_context)
if token.end_with?('%}')
yield token, token
else
BlockBody.raise_missing_tag_terminator(token, parse_context)
end
end

private def parse_for_document(tokenizer, parse_context, &block)
while (token = tokenizer.shift)
next if token.empty?
case
when token.start_with?(TAGSTART)
whitespace_handler(token, parse_context)
unless token =~ FullToken
return yield token, token
return handle_invalid_tag_token(token, parse_context, &block)
end
tag_name = Regexp.last_match(2)
markup = Regexp.last_match(4)
Expand Down

0 comments on commit 2c0c672

Please sign in to comment.