html5-php
html5-php copied to clipboard
Support render PHP8.4 \Dom\HTMLDocument
This is a simple fix for rendering PHP 8.4 HTMLDocument, this PR dosen't support the parsing of new DOM.
$doc = \Dom\HTMLElement::createFromString($html);
$string = new HTML5()->saveHTML($doc);
Why
Currently, native PHP HTMLDocument still contains some rendering difference from this library, for instance, PHP rendered the boolean attributes as required="" however this library is required.
This PR make sure the new DOM can be rendered as same as the old DOM which is rendered by this library.