3 namespace Drupal\filter\Plugin\Filter;
5 use Drupal\filter\FilterProcessResult;
6 use Drupal\filter\Plugin\FilterBase;
9 * Provides a filter to convert line breaks to HTML.
12 * id = "filter_autop",
13 * title = @Translation("Convert line breaks into HTML (i.e. <code><br></code> and <code><p></code>)"),
14 * type = Drupal\filter\Plugin\FilterInterface::TYPE_MARKUP_LANGUAGE
17 class FilterAutoP extends FilterBase {
22 public function process($text, $langcode) {
23 return new FilterProcessResult(_filter_autop($text));
29 public function tips($long = FALSE) {
31 return $this->t('Lines and paragraphs are automatically recognized. The <br /> line break, <p> paragraph and </p> close paragraph tags are inserted automatically. If paragraphs are not recognized simply add a couple of blank lines.');
34 return $this->t('Lines and paragraphs break automatically.');