AutoP filter should handle intentionally added line breaks

Created on 3 April 2018, almost 7 years ago
Updated 24 June 2023, over 1 year ago

When autop filter is turned on, the preg_replace function shown above, makes paragraphs on paragraphs that end with double space.

      // make paragraphs, including one at the end
      $chunk = '<p>' . preg_replace('/\n\s*\n\n?(.)/', "</p>\n<p>$1", $chunk) . "</p>\n";

So, when the filter would work on is:

  $input = "aaa\nbbb\n\nccc\n\n\nddd\n\n\n\neee";
  $output = FilterAutoP::process($input);     // output:  "<p>aaa<br />\nbbb</p>\n<p>ccc</p>\n<p>ddd</p>\n<p>eee</p>"

The extra line breaks created should be processed as additional linebreaks:

  $input = "aaa\nbbb\n\nccc\n\n\nddd\n\n\n\neee";
  $output = FilterAutoP::process($input);     // output:  "<p>aaa<br />\nbbb</p>\n<p>ccc<br />\n</p>\n<p>ddd<br />\n<br />\n</p>\n<p>eee</p>"
✨ Feature request
Status

Closed: outdated

Version

11.0 πŸ”₯

Component
FilterΒ  β†’

Last updated 5 days ago

No maintainer
Created by

πŸ‡¨πŸ‡΄Colombia gpelaez

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

  • πŸ‡ΊπŸ‡ΈUnited States smustgrave

    Since there has not been a follow up for #12 going to close for now.

    If still a valid request please reopen updating issue summary

    Thanks!

Production build 0.71.5 2024