-
-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
Cannot use the plus sign(+) for whitespace control: tag name expected #748
Comments
Why no motivation to fix this?
|
We would be happy to fix this. Unfortunately, we maintain this as volunteers with limited free time. We rely on the community to contribute analysis and patches to fill in when we can't. If you are affected by this and are interested in fixing it, please submit a PR. |
The issue here just appears to be that when lstrip_blocks = False, the syntax "{%+ statement %}" fails with error message "jinja2.exceptions.TemplateSyntaxError: tag name expected". This is more or less expected behavior because there's nothing to disable if lstrip_blocks is already disabled, but it could fail a little more elegantly. Example: This works:
This does not:
|
I discussed this issue with @davidism and he suggested that the underlying syntax of templates should not change when |
Allow '{%+' to be valid syntax (but NOP) when lstrip_blocks == False. Fixes #748
Expected Behavior
Assuming
trim_blocks
is alwaysFalse
.When
lstrip_blocks
is set toTrue
, jinja should outputAnd when it's
False
, jinja should outputActual Behavior
In either case,
Template Code
The following template also has a similar issue:
Full Traceback
Your Environment
The text was updated successfully, but these errors were encountered: