You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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.
The text was updated successfully, but these errors were encountered:
HTML5DomDocument is based on the native DOMDocument library, which automatically makes this conversion (which is great because my library is focused on HTML5).
Maybe it's possible to add some code to keep the slashed, but it will impact the performance (when loading and saving HTML). Would you like to contribute such code, and maybe we can enable it only an option is specified?
<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.<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.The text was updated successfully, but these errors were encountered: