To make this occur again:

Create a document with more than one paragraph.
Create an opening and closing pre element (with content in it) between the paragraphs but be sure to leave at least one paragraph below it.

The result will cause the sentences below the pre elements to not be processed correctly and output without any extra HTML such as p or br. This causes multiple lined sentences to line up on a single line yet properly spaced in the source code and when editing the page.

You can test this by then copying the data below the pre tag and moving it above the pre section and without any spacing modification and it works just fine with proper processing.

My dummy text I've attached contains multiple paragraphs/lines, with multiple pre elements, everything below the first pre stops processing properly but all other pre tags process just fine.

This occurs in Filtered (with pre added to allowed) and Full HTML settings. With filtered html i've tried setting the Filter Processing Order weight on the "Convert line breaks" higher and lower than the others without success.

Comments

dfletcher’s picture

Status: Active » Needs review
StatusFileSize
new752 bytes

In _filter_autop(), the test for $open was:

$open = ($chunk[1] != '/' || $chunk[1] != '!');

With this, $open will NEVER be false. Solution is simply:

$open = ($chunk[1] != '/' && $chunk[1] != '!');

chx’s picture

Version: 7.0 » 7.x-dev
Status: Needs review » Needs work
Issue tags: +Needs tests

Nice catch.

dfletcher’s picture

StatusFileSize
new2.77 KB

When writing a test for this bug, another test in filter.test failed: the one that has comment "Skip contents of certain block tags entirely". The reason this test failed is because `iframe` was missing from the list of tags that need to be ignored.

A separate bug points out a problem that this causes: http://drupal.org/node/810824 ... paragraph tags are placed around iframes.

So I've added that minor fix to this patch as well, along with two unit tests that check each condition: [a] does the filter work after a pre tag (this bug), and [b] assert that p tags do not appear around iframes (bug 810824).

dfletcher’s picture

Status: Needs work » Needs review
dfletcher’s picture

StatusFileSize
new1.53 KB

Patch re-rolled without the iframe fix - I made a mistake of wanting the unittest to pass, so the patch v2 tries to do too much. The iframe fix is now posted on bug 810824.

The unittest will not pass until http://drupal.org/node/810824#comment-4076026 is applied.

Status: Needs review » Needs work

The last submitted patch, 1054632-v3.patch, failed testing.

dfletcher’s picture

Status: Needs work » Postponed

Postponed because this bug requires http://drupal.org/node/810824 to be completed first.

scito’s picture

scito’s picture

damien tournoud’s picture

Status: Postponed » Closed (duplicate)

Marking as a duplicate of #1063178: Line break filter will ignore everything following a <pre>xxx</pre>, which has a proper fix (the logic around comments is totally bogus right now).