Closed (fixed)
Project:
Drupal core
Version:
7.x-dev
Component:
filter.module
Priority:
Normal
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
16 Feb 2011 at 10:11 UTC
Updated:
8 Apr 2011 at 00:27 UTC
Jump to comment: Most recent file
Comments
Comment #1
hazaAdded a test case in filter module to test this.
Comment #2
hazaComment #3
hazaAnd here is the patch (including tests) for this issue
Comment #4
damien tournoud commentedThis is a regression introduced by #559584: filter_xss() and Line break filter break HTML comments.
Comment #5
scito#1029108: Comments confuse line/paragraph filter and #1054632: Lines and paragraphs stop converting to individual p and br tags after pre tag. are related or result from the same problem.
Comment #6
damien tournoud commentedMarked #1029108: Comments confuse line/paragraph filter and #1054632: Lines and paragraphs stop converting to individual p and br tags after pre tag. because those two fail to realize that the logic around comments is currently completely bogus: a comment will reset the ignore mode so any comment in a
<pre>tag for example would make the text after the comment replaced for paragraphs.So needs work here for:
<pre>tagsComment #7
sunWhy do we fiddle with IFRAMEs here though? That's tackled in #810824: Line break filter adds paragraphs around <iframe> elements already.
Comment #8
hazaRework patch with the feedbacks from DamZ
Comment #9
damien tournoud commentedThe hunk about the iframe is necessary because we have a test for it:
The test currently passes because of this bug (anything after the first
<script>will be ignored by the line break filter anyway).Comment #10
damien tournoud commentedCross post.
Comment #11
hazaFixing some typo, and added test from #810824: Line break filter adds paragraphs around <iframe> elements on DamZ request
Comment #12
damien tournoud commentedThis looks good to me.
Quick summary: this patch fixes the comment handling logic introduced by #559584: filter_xss() and Line break filter break HTML comments. When the line-break filter bumps into a comment, it should just ignore it. Comments should not affect the state of the line-break filter, and should have no effect on whether or not the line-break filter should process content before or after the comment.
Two related changes are in the patch:
<iframe>to the list of ignored elements: we had a test for it, but it was only passing because of this bugThis looks ready to go in for me, but I worked with Haza on that patch, so I will wait for someone else to RTBC.
Comment #13
sunYup, ready to fly.
Comment #14
dries commentedCommitted to CVS HEAD. Thanks.
Comment #15
yched commentedI've also seen this behavior on d.o after
tags. Dunno if this is related - and if it is, if it should be backported ?
Comment #16
damien tournoud commentedIt seems that the line break filter diverged between D6 and D7. This was not supposed to happen...
Comment #17
yched commentedGrr. My #15 should have read :
I've also seen this behavior on d.o after
<code>tags. Dunno if this is related - and if it is, if it should be backported ?Comment #19
agileware commentedFor people searching the issue queue for bugs it helpful to mention that this fix fixes the following bug also:
The teaser
<!--break-->comment tag breaks the 'Convert line breaks into HTML (i.e. <br> and <p>)' filter.