mirror of
https://github.com/Shopify/liquid.git
synced 2026-09-20 11:20:41 -07:00
Allow raw tag to be used with whitespace control
This commit is contained in:
@@ -14,7 +14,7 @@ module Liquid
|
|||||||
# @liquid_syntax_keyword expression The expression to be output without being rendered.
|
# @liquid_syntax_keyword expression The expression to be output without being rendered.
|
||||||
class Raw < Block
|
class Raw < Block
|
||||||
Syntax = /\A\s*\z/
|
Syntax = /\A\s*\z/
|
||||||
FullTokenPossiblyInvalid = /\A(.*)#{TagStart}\s*(\w+)\s*(.*)?#{TagEnd}\z/om
|
FullTokenPossiblyInvalid = /\A(.*)#{TagStart}#{WhitespaceControl}?\s*(\w+)\s*(.*)?#{WhitespaceControl}?#{TagEnd}\z/om
|
||||||
|
|
||||||
def initialize(tag_name, markup, parse_context)
|
def initialize(tag_name, markup, parse_context)
|
||||||
super
|
super
|
||||||
|
|||||||
@@ -12,6 +12,7 @@ class RawTagTest < Minitest::Test
|
|||||||
|
|
||||||
def test_output_in_raw
|
def test_output_in_raw
|
||||||
assert_template_result('{{ test }}', '{% raw %}{{ test }}{% endraw %}')
|
assert_template_result('{{ test }}', '{% raw %}{{ test }}{% endraw %}')
|
||||||
|
assert_template_result('{{ test }}', '{%- raw -%}{{ test }}{%- endraw -%}')
|
||||||
end
|
end
|
||||||
|
|
||||||
def test_open_tag_in_raw
|
def test_open_tag_in_raw
|
||||||
|
|||||||
Reference in New Issue
Block a user