You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@sling.apache.org by "Radu Cotescu (JIRA)" <ji...@apache.org> on 2016/08/31 09:39:21 UTC

[jira] [Comment Edited] (SLING-5841) Self closing DIV when using 'html' context in Sightly

    [ https://issues.apache.org/jira/browse/SLING-5841?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15451744#comment-15451744 ] 

Radu Cotescu edited comment on SLING-5841 at 8/31/16 9:39 AM:
--------------------------------------------------------------

Sightly does support HTML5. That expression however ({{$\{'<div></div>' @context='html'}}}) is passed to the XSS API for validation, with the {{html}} context. The filtering will be performed by the AntiSamy library, which by default is configured to use XHTML for filtering, in order to not automatically append closing tags to self-closing ones. For that empty {{div}}, AntiSamy will convert the tag to {{<div/>}}. There are two workarounds:

# {{$\{'<div> </div>' @context='html'\}}}
# {{<custom-tag data-sly-element="$\{'div' @ context='html'\}"></custom-tag>}}



was (Author: radu.cotescu):
Sightly does support HTML5. That expression however ({{$\{'<div></div>' @context='html'\}}}) is passed to the XSS API for validation, with the {{html}} context. The filtering will be performed by the AntiSamy library, which by default is configured to use XHTML for filtering, in order to not automatically append closing tags to self-closing ones. For that empty {{div}}, AntiSamy will convert the tag to {{<div/>}}. There are two workarounds:

# {{$\{'<div> </div>' @context='html'\}}}
# {{<custom-tag data-sly-element="$\{'div' @ context='html'\}"></custom-tag>}}


> Self closing DIV when using 'html' context in Sightly
> -----------------------------------------------------
>
>                 Key: SLING-5841
>                 URL: https://issues.apache.org/jira/browse/SLING-5841
>             Project: Sling
>          Issue Type: Bug
>          Components: Extensions
>            Reporter: Dan Chapman
>            Priority: Minor
>
> When I do:
> ${'<div></div>' @context='html'}
> It outputs invalid HTML, it self-closes the element:
> <div/>
> Only a set number of elements are permitted to self-close - http://xahlee.info/js/html5_non-closing_tag.html.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)