mirror of
https://github.com/Shopify/liquid.git
synced 2026-09-20 11:20:41 -07:00
update grammar to support #
This commit is contained in:
@@ -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/
|
||||||
|
|||||||
@@ -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!
|
||||||
|
|||||||
Reference in New Issue
Block a user