diff --git a/lib/liquid/tags/raw.rb b/lib/liquid/tags/raw.rb index 947398b0..7f3dec9b 100644 --- a/lib/liquid/tags/raw.rb +++ b/lib/liquid/tags/raw.rb @@ -26,6 +26,7 @@ module Liquid @body = +'' while (token = tokens.shift) if token =~ FullTokenPossiblyInvalid && block_delimiter == Regexp.last_match(2) + parse_context.trim_whitespace = (token[-3] == WhitespaceControl) @body << Regexp.last_match(1) if Regexp.last_match(1) != "" return end diff --git a/test/integration/tags/raw_tag_test.rb b/test/integration/tags/raw_tag_test.rb index 7e818129..3629f39c 100644 --- a/test/integration/tags/raw_tag_test.rb +++ b/test/integration/tags/raw_tag_test.rb @@ -13,8 +13,9 @@ 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("> inner <", "> {%- raw -%} inner {%- endraw %} <") + assert_template_result("> inner <", "> {%- raw -%} inner {%- endraw -%} <") end def test_open_tag_in_raw