Download & Extend

[Filter] FULL HTML filter with HTML corrector enabled break comments <!-- ..... -->

Project:Drupal core
Version:6.1
Component:filter.module
Category:bug report
Priority:normal
Assigned:Unassigned
Status:closed (duplicate)

Issue Summary

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.

AttachmentSizeStatusTest resultOperations
filter_drupal6_fix_comments.diff662 bytesIgnored: Check issue status.NoneNone

Comments

#1

Status:active» needs review

#2

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

#3

Status:needs review» closed (duplicate)

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

nobody click here