public static Html::normalize($html)
Normalizes an HTML snippet.
This function is essentially \DOMDocument::normalizeDocument(), but operates on an HTML string instead of a \DOMDocument.
string $html: The HTML string to normalize.
string The normalized HTML string.
public static function normalize($html) { $document = static::load($html); return static::serialize($document); }
© 2001–2016 by the original authors
Licensed under the GNU General Public License, version 2 and later.
Drupal is a registered trademark of Dries Buytaert.
https://api.drupal.org/api/drupal/core!lib!Drupal!Component!Utility!Html.php/function/Html::normalize/8.1.x