update grammar to support #

This commit is contained in:
Sam Doiron
2021-01-29 17:06:16 -05:00
parent f331204f7c
commit 2d6bf406dd
2 changed files with 2 additions and 2 deletions
+1 -1
View File
@@ -4,7 +4,7 @@ require 'English'
module Liquid module Liquid
class BlockBody class BlockBody
LiquidTagToken = /\A\s*(\w+)\s*(.*?)\z/o LiquidTagToken = /\A\s*([\w#]+)\s*(.*?)\z/o
FullToken = /\A#{TagStart}#{WhitespaceControl}?(\s*)(\w+)(\s*)(.*?)#{WhitespaceControl}?#{TagEnd}\z/om FullToken = /\A#{TagStart}#{WhitespaceControl}?(\s*)(\w+)(\s*)(.*?)#{WhitespaceControl}?#{TagEnd}\z/om
ContentOfVariable = /\A#{VariableStart}#{WhitespaceControl}?(.*?)#{WhitespaceControl}?#{VariableEnd}\z/om ContentOfVariable = /\A#{VariableStart}#{WhitespaceControl}?(.*?)#{WhitespaceControl}?#{VariableEnd}\z/om
WhitespaceOrNothing = /\A\s*\z/ WhitespaceOrNothing = /\A\s*\z/
+1 -1
View File
@@ -7,7 +7,7 @@ class InlineCommentTest < Minitest::Test
def test_basic_usage def test_basic_usage
template_source = <<-END_TEMPLATE template_source = <<-END_TEMPLATE
foo{% -- this is a comment %}bar foo{% # this is a comment %}bar
END_TEMPLATE END_TEMPLATE
template = Template.parse(template_source) template = Template.parse(template_source)
rendered = template.render! rendered = template.render!