X-Git-Url: http://www.aleph1.co.uk/gitweb/?a=blobdiff_plain;f=web%2Fcore%2Fmodules%2Ffilter%2Fsrc%2FPlugin%2FFilter%2FFilterAutoP.php;fp=web%2Fcore%2Fmodules%2Ffilter%2Fsrc%2FPlugin%2FFilter%2FFilterAutoP.php;h=2e96654358aab95009b2746d6de6def2520532a4;hb=a2bd1bf0c2c1f1a17d188f4dc0726a45494cefae;hp=0000000000000000000000000000000000000000;hpb=57c063afa3f66b07c4bbddc2d6129a96d90f0aad;p=yaffs-website diff --git a/web/core/modules/filter/src/Plugin/Filter/FilterAutoP.php b/web/core/modules/filter/src/Plugin/Filter/FilterAutoP.php new file mode 100644 index 000000000..2e9665435 --- /dev/null +++ b/web/core/modules/filter/src/Plugin/Filter/FilterAutoP.php @@ -0,0 +1,38 @@ +<br> and <p>)"), + * type = Drupal\filter\Plugin\FilterInterface::TYPE_MARKUP_LANGUAGE + * ) + */ +class FilterAutoP extends FilterBase { + + /** + * {@inheritdoc} + */ + public function process($text, $langcode) { + return new FilterProcessResult(_filter_autop($text)); + } + + /** + * {@inheritdoc} + */ + public function tips($long = FALSE) { + if ($long) { + 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.'); + } + else { + return $this->t('Lines and paragraphs break automatically.'); + } + } + +}