Open
Description
<br />
and <br>
are both valid styles in how to express void elements in HTML5.
IvoPetkov\HTML5DOMDocument
always converts void-elements-with-slashes to void-elements-without-slashes, e.g.
use IvoPetkov\HTML5DOMDocument;
$dom = new HTML5DOMDocument();
$dom->loadHTML('<!DOCTYPE html><html><body>Hello <br /> another text</body></html>');
$result= $dom->saveHTML();
/* $result
<!DOCTYPE html>
<html><body>Hello <br> another text</body></html>
*/
<br />
was changed to <br>
.
Unfortunately, XHTML does not support void-elements-without-slashes. For compatibility with downstream XHMTL parsers, it would be great if IvoPetkov\HTML5DOMDocument
keeps the void element style of input elements unchanged.
Metadata
Metadata
Assignees
Labels
No labels