class FilterHtmlCorrector

Same name and namespace in other branches
  1. 11.x core/modules/filter/src/Plugin/Filter/FilterHtmlCorrector.php \Drupal\filter\Plugin\Filter\FilterHtmlCorrector

Provides a filter to correct faulty and chopped off HTML.

Plugin annotation


@Filter(
  id = "filter_htmlcorrector",
  title = @Translation("Correct faulty and chopped off HTML"),
  type = Drupal\filter\Plugin\FilterInterface::TYPE_TRANSFORM_IRREVERSIBLE,
  weight = 10
)

Hierarchy

Expanded class hierarchy of FilterHtmlCorrector

File

core/modules/filter/src/Plugin/Filter/FilterHtmlCorrector.php, line 19

Namespace

Drupal\filter\Plugin\Filter
View source
class FilterHtmlCorrector extends FilterBase {
  
  /**
   * {@inheritdoc}
   */
  public function process($text, $langcode) {
    return new FilterProcessResult(Html::normalize($text));
  }

}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.