3 namespace Drupal\filter\Plugin\Filter;
5 use Drupal\Component\Utility\Html;
6 use Drupal\filter\FilterProcessResult;
7 use Drupal\filter\Plugin\FilterBase;
10 * Provides a filter to correct faulty and chopped off HTML.
13 * id = "filter_htmlcorrector",
14 * title = @Translation("Correct faulty and chopped off HTML"),
15 * type = Drupal\filter\Plugin\FilterInterface::TYPE_TRANSFORM_IRREVERSIBLE,
19 class FilterHtmlCorrector extends FilterBase {
24 public function process($text, $langcode) {
25 return new FilterProcessResult(Html::normalize($text));