Skip to content

Commit

Permalink
Merge pull request #1683 from Shopify/marco/raw-tag-whitespace-control
Browse files Browse the repository at this point in the history
Allow raw tag to be used with whitespace control
  • Loading branch information
Maaarcocr authored Feb 1, 2023
2 parents 6a888d4 + ddc32b7 commit 22ded5f
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
2 changes: 1 addition & 1 deletion lib/liquid/tags/raw.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
3 changes: 2 additions & 1 deletion test/integration/tags/raw_tag_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,8 @@ def test_tag_in_raw
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
Expand Down

0 comments on commit 22ded5f

Please sign in to comment.