html5-dom-document-php icon indicating copy to clipboard operation
html5-dom-document-php copied to clipboard

A better HTML5 parser for PHP.

Results 8 html5-dom-document-php issues
Sort by recently updated
recently updated
newest added

I come from simplehtmldom and have found your library, thank you very much for OpenSource! I need to go through all the elements in parent-child order, recursively. I really like...

[`` and `` are both valid styles in how to express void elements in HTML5](https://stackoverflow.com/a/3558200/923560). `IvoPetkov\HTML5DOMDocument` always converts void-elements-**with**-slashes to void-elements-**without**-slashes, e.g. ``` use IvoPetkov\HTML5DOMDocument; $dom = new HTML5DOMDocument(); $dom->loadHTML('Hello...

DomDocument has support for spatch selectors, which support most of the CSS selectors. By offloading the search to the builtin function, you should be able to get improve performance quite...

Just wondering why this doesn't produce "minified" HTML output: $dom = new IvoPetkov\HTML5DOMDocument(); $dom->preserveWhiteSpace = false; $dom->loadHTML($html); return $dom->saveHTML(); HTML5DOMDocument inherits from [DOMDocument](http://php.net/manual/de/class.domdocument.php) and that should have the preserveWhiteSpace property....

```php $html = '123'; $dom = new HTML5DOMDocument(); $dom->loadHTML($html); print_r($dom->querySelector('body>strong i')); ``` Throw InvalidArgumentException: Unsupported selector (body>strong i) at vendor/ivopetkov/html5-dom-document-php/src/HTML5DOMDocument/Internal/QuerySelectors.php:512 it's always happend on: `selectorA>selectorB selectorC`

Nice work. I have some suggestions. https://github.com/ivopetkov/html5-dom-document-php/blob/3eccd3ca69bc7d0789d10c23638a4eab9fc4050d/src/HTML5DOMDocument.php#L371 I think this unintentionally trims newlines in the end where it isn't needed. I think your intent is to remove newline somehow added...

Since XML is not HTML, using native `DOMDocumentFragment` and its `appendXML()` method is risky and prone to all the very same issues this library is trying to address.

The use of DOMDocument in my project generated a warning when using $success = $dom->loadHtml(''.$xml, LIBXML_HTML_NOIMPLIED | LIBXML_HTML_NODEFDTD); to load the Htmlstring and the Html-String was faulty. e.g. missing closing...