html5-php
html5-php copied to clipboard
An HTML5 parser and serializer for PHP.
`DOMDocument::Serialize`, which is called by Drupal's Html::normalize before Drupal 10, appears to fix mismatching tags, but HTML5-php does not. With DOMDocument, ` Html::normalize()` on `Heading` is giving `Heading`. With HTL5-php,`...
noscript tag with html inside is not ignored and resulting dom is different from html5 browsers
Parsing html with multiple html and body tags is inconsistent with the resulting dom tree compared to html5 browsers
If I manually modify a DOM document and add an entity reference, `HTML5::saveHTML()` does not give the same result as `DOMDocument::saveHTML()`: ``` $html5 = new Masterminds\HTML5(['disable_html_ns' => TRUE]); $dom =...
src/HTML5/Parser/UTF8Utils.php $data = mb_convert_encoding($data, 'UTF-8', $encoding); error if $data is null in PHP 8.1 help this: $data = mb_convert_encoding($data.'', 'UTF-8', $encoding);
Parsing a document containing `Test` produces a DOM element with a type attribute set to `button`. However, the HTML specification explicitly says that duplicate attributes must be ignored: https://html.spec.whatwg.org/multipage/parsing.html#parse-error-duplicate-attribute This...
## Observations We have noticed a number of parsing differences between the Masterminds/html5-php parser and the HTML5 specification. We think that the root cause of those issues drills down to...
I'm unable to reproduce, but one of Roundcube users created a ticket for this [here](https://github.com/roundcube/roundcubemail/issues/8826). This is with PHP 8.1.13: ``` PHP Fatal error: Uncaught Error: Typed property DOMDocument::$documentElement must...
The following deprecated notices were found while using the phpstan tool: all/libraries/composer/vendor/masterminds/html5/src/HTML5/Parser/StringInputStream.php 180 line Return type mixed of method Masterminds\HTML5\Parser\StringInputStream::current() is not covariant with tentative return type mixed of method...