public static function Html::normalize in Service Container 7
Same name and namespace in other branches
- 7.2 lib/Drupal/Component/Utility/Html.php \Drupal\Component\Utility\Html::normalize()
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
- lib/
Drupal/ Component/ Utility/ Html.php, line 236 - Contains \Drupal\Component\Utility\Html.
Class
- Html
- Provides DOMDocument helpers for parsing and serializing HTML strings.
Namespace
Drupal\Component\UtilityCode
public static function normalize($html) {
$document = static::load($html);
return static::serialize($document);
}