Merge pull request #1683 from Shopify/marco/raw-tag-whitespace-control

Allow raw tag to be used with whitespace control
This commit is contained in:
Marco Concetto Rudilosso
2023-02-01 16:51:46 +00:00
committed by GitHub
2 changed files with 3 additions and 2 deletions
+1 -1
View File
@@ -14,7 +14,7 @@ module Liquid
# @liquid_syntax_keyword expression The expression to be output without being rendered.
class Raw < Block
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)
super
+2 -1
View File
@@ -11,7 +11,8 @@ class RawTagTest < Minitest::Test
end
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
def test_open_tag_in_raw