#107277Trailing in for instance Image Viewhelper and html head result in Info messages in Nu Html Checker
Description
Not sure if this is a bug.
This is the rule (https://docs.typo3.org/other/typo3/view-helper-reference/13.4/en-us/Global/Image.html):
<f:image class="img-fluid" alt="{altText}" src="fileadmin/{file.identifier}" />
Leads to for instance:
<img class="img-fluid" alt="..." src="/fileadmin/identifier.png" width="996" height="394" />
On https://validator.w3.org/ a full validation results in:
Info: Trailing slash on void elements has no effect and interacts badly with unquoted attribute values.
Removing the trainling slash in a template leads to Oops! an error…
In additions, this also occurs for the html head, for instance:
<link rel="canonical" href="https://domain.tld/"/>Reviews 0
No change resolves or names this issue in its commit message, and no comment links one.
History 2
-
Garvin Hicking commented and changed category <span data-processor="relativetime" data-value="2025-08-13T11:01:09+00:00" > 08/13/25, 11:01 </span>
-
Garvin Hicking commented and changed status
NewClosed <span data-processor="relativetime" data-value="2026-11-10T21:48:22+00:00" > 11/10/26, 21:48 </span>Closing the issue. I’d argue HTML5 doesn’t care too much about validation, and changing this might affect tooling. Hope that’s fine with you!
Basically this is a “XHTML” vs “HTML5” markup issue. We still have occurrences of the more strict xhtml syntax i comparison to lax HTML5.
This is more of a “beauty” issue because HTML5 is meant to be very forgiving. So honestly, validating HTML5 for markup syntax is kind of a defeating approach. All browsers deal easily with the self-closing tags.
We do have the doctype switch so technically we could evaluate this, but it would mean a bit of work for little gain and theoretically less compatibility than before…. so, not to sure how this will change. I’ve asked for thoughts on this :-)
(Btw – the img tag is emitted from the ViewHelper, and these always adhere to xhtml and would need self-closing tags. These are not rendered and do not influence the actual markup output on the frontend)