How to leave html comments in place, with 'Filtered HTML' option on?

gabble - June 20, 2005 - 08:55

I need to leave html comments in place with 'Filtered html' enabled... they get stripped everytime! Is there a way to avoid that?

The real thing is I need to insert <!--pagebreak--> comments for my pagination module, and it remains in place only if "Full HTML" option is on... but I don't want to enable unfiltered html for every poster...

Hope you can help me! :-)

Hardcoded in PHP

Steven - June 20, 2005 - 09:16

The HTML filter uses PHP's strip_tags() function, which is hardcoded to remove HTML comments. The only way around that is to replace <!-- and -->with some out-of-band markers before stripping, and reinsert them later.

--
If you have a problem, please search before posting a question.

htmLawed

smokris - April 8, 2009 - 20:53

...or (now, several years in the future) you could replace "HTML Filter" with http://drupal.org/project/htmLawed, and configure it to pass HTML Comments through.

- smokris

 
 

Drupal is a registered trademark of Dries Buytaert.