-
Notifications
You must be signed in to change notification settings - Fork 2.7k
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
Qute @CheckedTemplate
ignores SELECTED_VARIANT
for HTML escaping
#21730
Comments
/cc @mkouba |
You added a link to a Zulip discussion, please make sure the description of the issue is comprehensive and doesn't require accessing Zulip.
|
Well, the selected variant has no effect because the The selected variant is only used to choose the correct template for an injected
Locale and charset negotiation is not implemented yet and it's a known issue. |
But isn't "html or txt" a perfect example that shows escaping should respect the selected variant? I mean, txt doesn't need escaping, but html does. |
Indeed, but for |
Only for known content-types, though (which cover most cases but not all). |
@CheckedTemplates
ignore SELECTED_VARIANT
for HTML escaping@CheckedTemplate
ignores SELECTED_VARIANT
for HTML escaping
@famod I'm going to close this one. Feel free to reopen if needed. |
Describe the bug
I have xhtml templates for generation of emails and pdf conversion.
To avoid a warning message I have set the proper content-type:
The render call tooks like this:
Variant:
This variant seems to be ignored because I can only see the implicitly created variant with
application/xhtml+xml
being passed toHtmlEscaper
, not my selected variant.Since escaping is hard-coded to be only done for text/html and text/xml, there will be no escaping here.
Workaround:
(or html)
But what about locale and charset? I'm under the impression that the selected variant is irgnored for everything, not just html escaping?
Expected behavior
Selected variant should be used or if this is not supported by design, an actionable exception should be thrown and documentation should be extended.
Actual behavior
Selected variant is ignored silently.
How to Reproduce?
No response
Output of
uname -a
orver
No response
Output of
java -version
No response
GraalVM version (if different from Java)
No response
Quarkus version or git rev
2.5.0.Final
Build tool (ie. output of
mvnw --version
orgradlew --version
)No response
Additional information
https://quarkusio.zulipchat.com/#narrow/stream/187030-users/topic/Qute.20and.20XML.20templates.20.28char.20escaping.20issues.29/near/262782613
Somewhat related: #21405
The text was updated successfully, but these errors were encountered: