Updated Drupal to 8.6. This goes with the following updates because it's possible...
[yaffs-website] / web / core / modules / filter / src / Plugin / Filter / FilterHtmlCorrector.php
1 <?php
2
3 namespace Drupal\filter\Plugin\Filter;
4
5 use Drupal\Component\Utility\Html;
6 use Drupal\filter\FilterProcessResult;
7 use Drupal\filter\Plugin\FilterBase;
8
9 /**
10  * Provides a filter to correct faulty and chopped off HTML.
11  *
12  * @Filter(
13  *   id = "filter_htmlcorrector",
14  *   title = @Translation("Correct faulty and chopped off HTML"),
15  *   type = Drupal\filter\Plugin\FilterInterface::TYPE_TRANSFORM_IRREVERSIBLE,
16  *   weight = 10
17  * )
18  */
19 class FilterHtmlCorrector extends FilterBase {
20
21   /**
22    * {@inheritdoc}
23    */
24   public function process($text, $langcode) {
25     return new FilterProcessResult(Html::normalize($text));
26   }
27
28 }