lib/liquid/block_body.rb in liquid-5.3.0 vs lib/liquid/block_body.rb in liquid-5.4.0

- old
+ new

@@ -2,12 +2,12 @@ require 'English' module Liquid class BlockBody - LiquidTagToken = /\A\s*(\w+)\s*(.*?)\z/o - FullToken = /\A#{TagStart}#{WhitespaceControl}?(\s*)(\w+)(\s*)(.*?)#{WhitespaceControl}?#{TagEnd}\z/om + LiquidTagToken = /\A\s*(#{TagName})\s*(.*?)\z/o + FullToken = /\A#{TagStart}#{WhitespaceControl}?(\s*)(#{TagName})(\s*)(.*?)#{WhitespaceControl}?#{TagEnd}\z/om ContentOfVariable = /\A#{VariableStart}#{WhitespaceControl}?(.*?)#{WhitespaceControl}?#{VariableEnd}\z/om WhitespaceOrNothing = /\A\s*\z/ TAGSTART = "{%" VARSTART = "{{" @@ -35,11 +35,11 @@ super end private def parse_for_liquid_tag(tokenizer, parse_context) while (token = tokenizer.shift) - unless token.empty? || token =~ WhitespaceOrNothing + unless token.empty? || token.match?(WhitespaceOrNothing) unless token =~ LiquidTagToken # line isn't empty but didn't match tag syntax, yield and let the # caller raise a syntax error return yield token, token end @@ -148,10 +148,10 @@ if parse_context.trim_whitespace token.lstrip! end parse_context.trim_whitespace = false @nodelist << token - @blank &&= !!(token =~ WhitespaceOrNothing) + @blank &&= token.match?(WhitespaceOrNothing) end parse_context.line_number = tokenizer.line_number end yield nil, nil