We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
tojson
tojson always escape ' to \u0027 even if autoescape=False, actually it also happens to <, >, &
'
\u0027
autoescape=False
<
>
&
>>> import jinja2 >>> env = jinja2.Environment(autoescape=False) >>> t = env.from_string("{{ x|tojson }}") >>> print(t.render(x="'")) "\u0027"
I think the expected output should be "'"
"'"
Environment:
The text was updated successfully, but these errors were encountered:
Sorry, but what does not planned mean here? Is it a feature or due to inappropriate setting? Or it's duplicated? Or won't fix?
not planned
Sorry, something went wrong.
My bad, didn't mean to close this.
Happy to review a PR, the tojson filter already gets the eval context which has the autoescape state.
autoescape
Successfully merging a pull request may close this issue.
tojson
always escape'
to\u0027
even ifautoescape=False
, actually it also happens to<
,>
,&
I think the expected output should be
"'"
Environment:
The text was updated successfully, but these errors were encountered: