Security update for Core, with self-updated composer
[yaffs-website] / web / core / modules / filter / src / Plugin / Filter / FilterAutoP.php
1 <?php
2
3 namespace Drupal\filter\Plugin\Filter;
4
5 use Drupal\filter\FilterProcessResult;
6 use Drupal\filter\Plugin\FilterBase;
7
8 /**
9  * Provides a filter to convert line breaks to HTML.
10  *
11  * @Filter(
12  *   id = "filter_autop",
13  *   title = @Translation("Convert line breaks into HTML (i.e. <code>&lt;br&gt;</code> and <code>&lt;p&gt;</code>)"),
14  *   type = Drupal\filter\Plugin\FilterInterface::TYPE_MARKUP_LANGUAGE
15  * )
16  */
17 class FilterAutoP extends FilterBase {
18
19   /**
20    * {@inheritdoc}
21    */
22   public function process($text, $langcode) {
23     return new FilterProcessResult(_filter_autop($text));
24   }
25
26   /**
27    * {@inheritdoc}
28    */
29   public function tips($long = FALSE) {
30     if ($long) {
31       return $this->t('Lines and paragraphs are automatically recognized. The &lt;br /&gt; line break, &lt;p&gt; paragraph and &lt;/p&gt; close paragraph tags are inserted automatically. If paragraphs are not recognized simply add a couple of blank lines.');
32     }
33     else {
34       return $this->t('Lines and paragraphs break automatically.');
35     }
36   }
37
38 }