You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@sling.apache.org by "Paul Bjorkstrand (Jira)" <ji...@apache.org> on 2020/10/15 14:01:00 UTC

[jira] [Comment Edited] (SLING-9829) data-sly-element should correctly handle void elements

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

Paul Bjorkstrand edited comment on SLING-9829 at 10/15/20, 2:00 PM:
--------------------------------------------------------------------

Though it would be bad form to add children to an eventual void element, I am curious how you will handle when the element name is for a void element, but the actual element has child nodes (text content or other elements). It might be worthwhile to at least debug log when that situation occurs, something along the lines of "The name in data-sly-element <element name> is a void element, all children of this element will be ignored/removed"

Thoughts?


was (Author: paul.bjorkstrand):
Though it would be bead form, I am curious how you will handle when the element name is for a void element, but the actual element has child nodes (text content or other elements). It might be worthwhile to at least debug log when that situation occurs, something along the lines of "The name in data-sly-element <element name> is a void element, all children of this element will be ignored/removed"

Thoughts?

> data-sly-element should correctly handle void elements
> ------------------------------------------------------
>
>                 Key: SLING-9829
>                 URL: https://issues.apache.org/jira/browse/SLING-9829
>             Project: Sling
>          Issue Type: Bug
>          Components: Scripting
>    Affects Versions: Scripting Sightly Engine 1.0.0, Scripting HTL Compiler 1.0.0, Scripting HTL Compiler 1.1.0-1.4.0, Scripting HTL Compiler 1.2.0-1.4.0
>            Reporter: Radu Cotescu
>            Assignee: Radu Cotescu
>            Priority: Major
>             Fix For: Scripting HTL Compiler 1.2.12-1.4.0
>
>
> The current implementation of {{data-sly-element}} doesn't correctly handle void elements which will replace the original element on which the block element was placed:
> When {{$\{item.element.name}}} evaluates to {{link}} or {{meta}}, the element will have a closing tag in the following example, although both {{link}} and {{meta}} are void elements:
> {code:html}
> <script data-sly-element="${item.element.name @ context='unsafe'}"></script>
> {code}



--
This message was sent by Atlassian Jira
(v8.3.4#803005)