-
-
Notifications
You must be signed in to change notification settings - Fork 42
Open
Description
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 and that should have the preserveWhiteSpace property. It defaults to true and according to numerous Stack Overflow answers, setting it to false produces output without whitespace-only text nodes, like indenting. It doesn't change my HTML in any way however.
The property does exist, is initially true, and is no longer true after setting it to false. It just has no effect here.
Metadata
Metadata
Assignees
Labels
No labels