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 2018/03/20 03:53:00 UTC

[jira] [Created] (SLING-7549) tag is not being treated as "self closing" when used in conjunction with HTL block statements

Paul Bjorkstrand created SLING-7549:
---------------------------------------

             Summary: <link> tag is not being treated as "self closing" when used in conjunction with HTL block statements
                 Key: SLING-7549
                 URL: https://issues.apache.org/jira/browse/SLING-7549
             Project: Sling
          Issue Type: Bug
          Components: Scripting
    Affects Versions: Scripting HTL Engine 1.0.32
            Reporter: Paul Bjorkstrand


When using HTL block statements some tags that are assumed to be "self closing" by browsers are not handled in that manner by the HTL engine. This can cause hard to find problems with the rendering of the page. in this example, the {{<link>}} tag was the culprit. 

I was diagnosing an issue where under a certain set of circumstances all of my page's css was not being rendered. This happened to be due a {{<link>}} tag that was not closed, but had a block statement added to it:
{code:java}
<link data-sly-test="${metadata.prerenderUrl}" rel="prerender" href="${metadata.prerenderUrl}">{code}
That seemingly innocuous tag caused the HTL engine to assume that all contents following, (until the the parent head closing tag), to be inside that link tag.

According to the [html5 spec|https://www.w3.org/TR/2014/REC-html5-20141028/document-metadata.html#the-link-element] the content of the {{<link>}} element is empty. Nearly every browser in use today treats {{<link ...>}} the same as {{<link .../>}}. Given this, it is not a stretch to assume that HTL would treat it in the same manner.

It is my belief that HTL should mimic the html5 specification. At minimum, I would hope to get a clear answer on which HTML specification it follows, or a statement that HTL does not/will not follow an HTML specification.

*Note*: I was unsure if this should be something in the HTL spec or in the implementation. Since I found no reference in the specification regarding html5/xhtml/html4 compliance, I came here with my request instead. Please let me know if this is something that should be addressed at the specification level.



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)