Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow raw tag to be used with whitespace control #1683

Merged
merged 2 commits into from
Feb 1, 2023

Conversation

Maaarcocr
Copy link
Contributor

why?

Currently using the raw tag with whitespace control is unsupported, as it can be seen by removing my changes but keeping the new test.

how?

Just allow #{WhitespaceControl} to be there in the ending tag for raw.

@@ -12,6 +12,7 @@ def test_tag_in_raw

def test_output_in_raw
assert_template_result('{{ test }}', '{% raw %}{{ test }}{% endraw %}')
assert_template_result('{{ test }}', '{%- raw -%}{{ test }}{%- endraw -%}')
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This doesn't actually test the effect of the whitespace control characters. We don't want to support whitespace control characters if they don't actually strip text. E.g. I would expect

Suggested change
assert_template_result('{{ test }}', '{%- raw -%}{{ test }}{%- endraw -%}')
assert_template_result('>{{ test }}<', '> {%- raw -%} {{ test }} {%- endraw -%} <')

@Maaarcocr Maaarcocr merged commit 22ded5f into master Feb 1, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants