In Drupal 6.x version HTML Purifier can work well with Drupal internal input syntax <!--break--> for separate position of the node preview part within trimmed version, manually.

BTW, when installing HTML Purifier 7.x-2.x-dev, the <!--break--> syntax is no longer functioning. It looks like the <!--break--> syntax is being filtered by HTML Purifier and so Drupal core not able to capture and handle it.

I try to disable/enable either "HTML Purifier" or "HTML Purifier (advanced)" within a single text input filter, and always works ONLY when without HTML Purifier.

Maybe we are missing something during version upgrade from Drupal 6.x-2.x, or there should be some new and additional exception case in Drupal 7.x core input filtering system?

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

hswong3i’s picture

Please find the attached screenshot for more information.

kdhartstrom’s picture

I am also running into this same issue. I did find some ideas here http://htmlpurifier.org/phorum/read.php?3,4599,4599#msg-4599 that might be worth a try.

jeffwidman’s picture

subscribe

Anonymous’s picture

FileSize
557 bytes

I wrote a teeny tiny module that works around this by preprocessing the breaks into something HTML Purifier friendly and then processing them back into the standard break later. I've attached it (set it to run after HTML Purifier), but I think this is something that could easily be integrated into the HTML Purifier module itself in a similar manner.

scito’s picture

This problem is due to #881006: Regression: 'break' tag doesn't work with Filtered HTML of Drupal core. In Drupal 6 the break tag was processed before filters and now afterwards. All filters are affected by this problem.

djmy’s picture

subscribe

ezyang’s picture

Status: Active » Fixed

Fixed in upstream HTML Purifier 4.4.0, but you need some configuration: Turn on %HTML.AllowedComments, and %HTML.AllowedCommentsRegexp to allow break.

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.

drakythe’s picture

Category: bug » support
Priority: Critical » Normal
Status: Closed (fixed) » Active

I'm sorry to re-open this, but I'm a little confused. Is it possible to fix this via HTML Purifier, or does the core issue mentioned in #5 mean this is not possible to really fix right now?

And if it is fixable via html purifier, How is that done? I don't understand #7's commens...

heddn’s picture

It is possible to fix via HTML Purifier on D7. You have to use an advanced filter and use %HTML.AllowedComments, and %HTML.AllowedCommentsRegexp to allow the 'break' comment pass through the filter.

drakythe’s picture

Okay, I get that, but what settings do I use in order to get it to be allowed? If I simply uncheck the allowedcommentregexp disabled box I get a preg_match() error

drakythe’s picture

Status: Active » Closed (fixed)

Alright, I got this fixed. For anyone else who has this same issue, in the "AllowedCommentsRegexp" box, put this string
/^break$/
make sure to clear your HTML purifier cache, and you're done.

Note that this only works if the "Limit allowed HTML tags" Filter is off, as that breaks (heh, no pun intended) <!--break--> support, and is a core issue being discussed here #881006: Regression: 'break' tag doesn't work with Filtered HTML

mustardman’s picture

please delete this post. I found my problem