Needs review
Project:
HTML corrector
Version:
5.x-1.x-dev
Component:
Code
Priority:
Normal
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
12 Nov 2006 at 18:10 UTC
Updated:
15 Dec 2008 at 17:23 UTC
Jump to comment: Most recent file
Comments
Comment #1
seanburlington commentedI don't think commenting it out is a good idea
This will still turn extraneous <'s into <'s
$text = preg_replace('#<([^a-zA-Z/!])#', '<\1', $text);
while keeping comments as comments
Comment #2
dokumori commentedI had the same problem on 5.2, so I created a module that solves this problem.
It's an implementation of hook_filter that converts '<' to '<' and '>' to '>' only in the context of HTML comment.
Make sure you set the weight of HTML Corrector lighter than this module. It will not work otherwise.
The attachment has .patch extension, but it's a zip archive.
Comment #3
dokumori commentedoops. I meant to choose 'code needs review'
Comment #4
jcfiala commentedHere's a different patch, that doesn't involve adding a new module but which adds a new regex call and modifies a second so that html comments aren't turned into <!-- in the code. What do folks think?
Comment #5
davidwhthomas commentedjcfiala's patch works for me and fixes an annoying problem. thanks!
DT
Comment #6
gpk commentedSee also http://drupal.org/node/222926 (same issue but in the context of htmlcorrector as part of core filter.module in Drupal 6.x). I'd mark one or other duplicate except that these are now separate projects since htmlcorrector has been taken into core.
Comment #7
quicksketchMarked http://drupal.org/node/138098 as duplicate.
Comment #8
sunHm. It should be as easy as attached patch. Works for me (and Paging module).
Please test.
This issue needs to be moved into Drupal core's queue after this has been solved, so the fix gets also applied for D6+.
#167197: Not compatible with HTML Corrector module/filter has been marked as duplicate of this issue.
Comment #9
sunAha. So after reviewing the existing core issue in #222926: HTML Corrector filter escapes HTML comments, I've come up with attached solution.
Comment #10
chrisschaub commentedCan this last patch #9 get committed? It works fine.
Comment #11
jcnventuraNo it doesn't. The contents of the HTML comments are still processed by the filter. See #222926: HTML Corrector filter escapes HTML comments #12 for a more complete patch.
João
Comment #12
chrisschaub commentedBut your patch is for the Drupal 6 filter module, this patch is for the Drupal 5 htmlcorrector 3rd party module; Drupal 5 does not have the html corrector in core. This patch works fine with the pager module in my testing. Is your problem with multi-line comments?
Comment #13
jcnventuraHi,
Yes, the easier test is with multi-line comments (br gets introduced at the end of each line). However, if you insert invalid HTML in the comment, it will probably correct it for you, as the corrector is still active inside the comment. I have now seen that the patch here is way more complex than the 3-line pattern fixes in the Drupal 6 patch. Only the first pattern is changed, while the second pattern that is changed in D6 is left here alone.
João
Comment #14
vacilando commentedSame problem in Drupal 6.6. Turning off HTML corrector is a solution, but not a preferred one, of course. Subscribing.
Comment #15
todd nienkerk commentedPlease see my issue and patch for the core version of this module: #343236: HTML corrector encodes (entifies) <!--break--> tag.