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

Radu Cotescu commented on SLING-5945:
-------------------------------------

Well, I'm not sure how we could improve the exception's message: the HTML 
parser, wether that's separate or not, will see a tag end event, therefore the 
Sightly parser will receive this text node: {{$\{'<\{0\}>}} to process. 
Obviously, that's an expression start which will be processed by the Sightly 
parser.

The HTML parser must cope with tag soup as well, the reason for this being that 
you could compose the actual rendering of a page using multiple files, where 
you could very well open a tag in one and close it into another. If you have a 
suggestion for the documentation page I'd be happy to review it.

BTW, what you've tried to achieve here can now be done like in the following 
example, given that we've fixed SLING-5944:
{code:html}
<div data-sly-element="${'custom-tag' @ context='unsafe'}">Hello</div>
{code}

> Using opening angle brackets twice in expression language leads to token 
> recognition error
> ------------------------------------------------------------------------------------------
>
>                 Key: SLING-5945
>                 URL: https://issues.apache.org/jira/browse/SLING-5945
>             Project: Sling
>          Issue Type: Bug
>          Components: Scripting
>    Affects Versions: Scripting Sightly Engine 1.0.18
>            Reporter: Konrad Windszus
>            Assignee: Radu Cotescu
>             Fix For: Scripting Sightly Engine 1.0.20
>
>
> The following Sightly expression leads to an exception when used inside a 
> block element's content
> {code}
>  ${'<{0}> </{0}>' @ format=['myelement'], context='unsafe'}
> {code}.
> The error is 
> {code}
> token recognition error at: ''<{0}>' for expression ${'<{0}>
>       at 
> org.apache.sling.scripting.sightly.impl.engine.UnitLoader.getSourceCodeForScript(UnitLoader.java:135)
> {code}
> On the other hand
> {code}
>  ${'<{0} /> ' @ format=['myelement'], context='unsafe'}
> {code}
> works without any issues.



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

Reply via email to