function HtmlSerializerRules::escape
Same name in other branches
- 10 core/lib/Drupal/Component/Utility/HtmlSerializerRules.php \Drupal\Component\Utility\HtmlSerializerRules::escape()
File
-
core/
lib/ Drupal/ Component/ Utility/ HtmlSerializerRules.php, line 28
Class
- HtmlSerializerRules
- Drupal-specific HTML5 serializer rules.
Namespace
Drupal\Component\UtilityCode
protected function escape($text, $attribute = FALSE) {
$text = parent::escape($text, $attribute);
if ($attribute) {
$text = strtr($text, [
'<' => '<',
'>' => '>',
]);
}
return $text;
}
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.