You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@sling.apache.org by "Konrad Windszus (Jira)" <ji...@apache.org> on 2025/05/28 11:19:00 UTC
[jira] [Comment Edited] (SLING-12808) HTL display context "text" doesn't encode spaces
[ https://issues.apache.org/jira/browse/SLING-12808?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17954552#comment-17954552 ]
Konrad Windszus edited comment on SLING-12808 at 5/28/25 11:18 AM:
-------------------------------------------------------------------
The implementation currently uses https://github.com/apache/sling-org-apache-sling-scripting-sightly/blob/830368475ba100e3bde18be49a73f79b1b927c14/src/main/java/org/apache/sling/scripting/sightly/impl/engine/extension/XSSRuntimeExtension.java#L96. The javadoc of https://sling.apache.org/apidocs/sling13/org/apache/sling/xss/XSSAPI.html#encodeForHTML(java.lang.String) is not very clear though. I tend to say this is rather a bug inside the XSSApi.
[~radu] Has this been discussed before. Do you consider this a bug?
was (Author: kwin):
The implementation currently uses https://github.com/apache/sling-org-apache-sling-scripting-sightly/blob/830368475ba100e3bde18be49a73f79b1b927c14/src/main/java/org/apache/sling/scripting/sightly/impl/engine/extension/XSSRuntimeExtension.java#L96. The javadoc of https://sling.apache.org/apidocs/sling13/org/apache/sling/xss/XSSAPI.html#encodeForHTML(java.lang.String) is not very clear though. I tend to say this is rather a bug inside the XSSApi.
> HTL display context "text" doesn't encode spaces
> ------------------------------------------------
>
> Key: SLING-12808
> URL: https://issues.apache.org/jira/browse/SLING-12808
> Project: Sling
> Issue Type: Bug
> Components: HTL
> Reporter: Konrad Windszus
> Priority: Major
>
> According to https://github.com/adobe/htl-spec/blob/1.4/SPECIFICATION.md#121-display-context the context {{text}} should be used ...
> bq. for simple HTML content - Encodes all HTML
> However this doesn't escape regular spaces. Particularly not consecutive spaces which are otherwise rendered as a single space as mandated by the HTML spec. I think this context needs to replace at least all leading/tailing spaces with {{&npsp;}} and also multiple consecutive spaces appearing anywhere else. Otherwise the given text will not be displayed as is (unmodified) to the end user.
--
This message was sent by Atlassian Jira
(v8.20.10#820010)