Step to reproduce:

- make sure Full html filter is set with HTML corrector enabled
- create a new block and add the following html:
-----------------
<script type="text/javascript">
<!--
google_ad_client = "pub-acdffggghh";
google_ad_slot = "4567890567";
google_ad_width = 468;
google_ad_height = 60;
//-->
</script>
<script type="text/javascript"
src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
</script>
---------------

The resulting block will be displayed as:
------------------
<script type="text/javascript">
&lt;!--
google_ad_client = "pub-acdffggghh";
google_ad_slot = "4567890567";
google_ad_width = 468;
google_ad_height = 60;
//-->
</script>
<script type="text/javascript"
src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
</script>
----------------------

Note, the "<!--" is converted into "&lt;!--".
A side effect is that the javascript code will not work

The cause for this is at line 770 of modules/filter/filter.module:
// Properly entify angles.
$text = preg_replace('!<([^a-zA-Z/])!', '&lt;\1', $text);

Please see below a patch that is solving this issue.

CommentFileSizeAuthor
filter_drupal6_fix_comments.diff662 byteschantra

Comments

chantra’s picture

Status: Active » Needs review
gpk’s picture

This is actually a duplicate of http://drupal.org/node/222926 but your patch looks rather neater...

sun’s picture

Status: Needs review » Closed (duplicate)

Marking as duplicate of #222926: HTML Corrector filter escapes HTML comments
Re-rolled and moved your patch over there.