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">
<!--
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 "<!--".
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/])!', '<\1', $text);
Please see below a patch that is solving this issue.
| Comment | File | Size | Author |
|---|---|---|---|
| filter_drupal6_fix_comments.diff | 662 bytes | chantra |
Comments
Comment #1
chantra commentedComment #2
gpk commentedThis is actually a duplicate of http://drupal.org/node/222926 but your patch looks rather neater...
Comment #3
sunMarking as duplicate of #222926: HTML Corrector filter escapes HTML comments
Re-rolled and moved your patch over there.