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.
| Comment | File | Size | Author |
|---|---|---|---|
| #5 | 1054632-v3.patch | 1.53 KB | dfletcher |
| #3 | 1054632-v2.patch | 2.77 KB | dfletcher |
| #1 | 1054632-v1.patch | 752 bytes | dfletcher |
| dummy_text.txt | 476 bytes | iarp |
Comments
Comment #1
dfletcher commentedIn _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] != '!');Comment #2
chx commentedNice catch.
Comment #3
dfletcher commentedWhen 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).
Comment #4
dfletcher commentedComment #5
dfletcher commentedPatch 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.
Comment #7
dfletcher commentedPostponed because this bug requires http://drupal.org/node/810824 to be completed first.
Comment #8
scito#1029108: Comments confuse line/paragraph filter is a duplicate.
Comment #9
scito#1063178: Line break filter will ignore everything following a <pre>xxx</pre> is related or a duplicate.
Comment #10
damien tournoud commentedMarking 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).