-
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Open
Description
Twig's |nl2br
filter outputs <br />
. The HTML validator discourages this:
Info: Trailing slash on void elements has no effect and interacts badly with unquoted attribute values.
Switching to <br>
has been suggested before: #1306
But it wouldn't be a good idea anyway, since a similar PR for <input />
got reverted later, due to issues with some HTML parser: symfony/symfony#47715
So, new suggestion to eventually get rid of those unnecessary slashes: ;-)
PHP's nl2br()
function has an argument $use_xhtml
to toggle between <br>
and <br />
. So just add this to Twig and everybody should be happy :-)
I could try to create a PR. For v3 or 4?
garak and milbau
Metadata
Metadata
Assignees
Labels
No labels