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.
Parameters
string $html: The HTML string to normalize.
Return value
string The normalized HTML string.
File
- core/lib/Drupal/Component/Utility/Html.php, line 250
Class
- Html
- Provides DOMDocument helpers for parsing and serializing HTML strings.
Namespace
Drupal\Component\Utility
Code
public static function normalize($html) { $document = static::load($html); return static::serialize($document); }
Please login to continue.