3 namespace Drupal\filter\Plugin\Filter;
5 use Drupal\filter\FilterProcessResult;
6 use Drupal\filter\Plugin\FilterBase;
9 * Provides a filter to display any HTML as plain text.
12 * id = "filter_html_escape",
13 * title = @Translation("Display any HTML as plain text"),
14 * type = Drupal\filter\Plugin\FilterInterface::TYPE_HTML_RESTRICTOR,
18 class FilterHtmlEscape extends FilterBase {
23 public function process($text, $langcode) {
24 return new FilterProcessResult(_filter_html_escape($text));
30 public function getHTMLRestrictions() {
31 // Nothing is allowed.
32 return ['allowed' => []];
38 public function tips($long = FALSE) {
39 return $this->t('No HTML tags allowed.');