Csaba Varga created SLING-12325: ----------------------------------- Summary: The HTL parser can get confused when HTML markup is present in string literals Key: SLING-12325 URL: https://issues.apache.org/jira/browse/SLING-12325 Project: Sling Issue Type: Bug Components: HTL Reporter: Csaba Varga
In some cases, HTL that's perfectly valid based on the spec will cause a compilation error. For example, this will be rejected when used outside of an attribute: {code:java} ${'<a href="{0}">Click here</a>.' @ format='/', context='html'} {code} The HTML parsing phase will consider the first closing brace to be the end of the expression, and the </a> part as a tag outside of an expression. The next phase will see this expression: {code:java} ${'<a href="{0}">Click here {code} and reject it as syntactically invalid. The HTML parsing phase needs to be more careful about expression syntax. I think it will need to look out for quotes and backslashes to safely tell whether a closing brace is an expression terminator or just a regular character inside a string literal. -- This message was sent by Atlassian Jira (v8.20.10#820010)