Closed (fixed)
Project:
HTML Purifier
Version:
6.x-2.0
Component:
Miscellaneous
Priority:
Normal
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
26 Aug 2009 at 15:01 UTC
Updated:
1 Mar 2010 at 16:40 UTC
Hey,
html purifier in drupal removes the HR tag when preceded by closing P tag and followed by an opening P tag except when those P's contain only a nbsp.
That is, <p>foo</p><hr /><p>bar</p> doesn't work but <p> </p><hr /><p> </p> does.
I have disabled all other filters, and have default settings for htmlpurifier.
However, if I put the same html in http://htmlpurifier.org/demo.php, there is no such problem, so I'd say the problem is probably in the drupal module.
Can you reproduce it or is it just me? :)
Thanks
Comments
Comment #1
himdel commentedAlso, ...something</ul><hr /><p>something... works just fine, the problem is only when there's a P on both sides.
Comment #2
ezyang commentedI can't seem to get hr tags to get output by Drupal at all, regardless of surrounding text. This is kind of strange. Investigating.
Comment #3
ezyang commentedOh no, I was mistaken. (I accidentally had an unclosed a tag in my post, which was causing hr to be disallowed). Are you sure you don't have any context HTML that could be messing up the hr tags? If you could find the line that has "$ret = $purifier->purify($text);" and then give me the contents of $ret and $text by placing a "var_dump($ret); var_dump($text);" afterwards that would also be useful.
Comment #4
iori57 commentedAny updates on this?
I'm using the latest html purifier version 6.x-2.1 and having the exact same problem :)
himdel is right, putting </ol><hr /><p> it will work fine... I manually add in <ol></ol> before every <hr /> tag and they all came out perfectly =.=
Comment #5
iori57 commentedI did an experiment, I input:
<hr />
<hr />
<p>abc</p>
<hr />
<hr />
<hr />
and the final html after purified is:
<hr />
<hr />
<p>abc</p>
<p>
</p>
seems that any <hr /> after paragraph <p> will some how disappear into thin air.. those before it will have no problem :)
Comment #6
kruser commentedThis was annoying for a while, but I got this to work by stripping out the blank spaces on either side of the
.
worked:
didn't work:
Comment #7
iori57 commented2440media2: can't read what you're writing..
Comment #8
ezyang commentedThis is a bug tickled by the AutoParagraph option (you can see this trigger if you turn on autoparagraphing in the demo page). It's a bug in the HTML Purifier library.
Comment #9
ezyang commentedFixed in HTML Purifier trunk. You can grab the patch here: http://repo.or.cz/w/htmlpurifier.git/commit/694583259c3d2a6d1a30fc5e9755...
Comment #10
kruser commentedsorry, I fixed that - forgot code tags