HTML corrector doesn't close quotation marks in teaser In Drupal6, I have a WYSIWYG input filter with the HTML Corrector filter enabled. When the body is automatically truncated for use in the teaser, sometimes the break occurs in the middle of an attribute value in an HTML tag (e.g. in the middle of the url in an anchor's href), resulting in an unclosed quotation mark. The HTML corrector appears to balance the unclosed tags appropriate, but it doesn't close the quotation mark.

For example, if my content body is the following one:

&lt;ul&gt;
  &lt;li&gt;&lt;a href="http://google.com"&gt;google.com&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;


The teaser breaks in the middle of the URL:

&lt;ul&gt;
  &lt;li&gt;&lt;a href="http://goog


Then the tags are closed but no closing quote or the end of the opening tag:

&lt;ul&gt;
  &lt;li&gt;&lt;a href="http://goog &lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;


The result is a broken theme. Am I doing anything wrong? Is there anything that is mis-configured?
Doesn't look like it's a problem on your side. You can try the following:

drush php-eval '$text = "&lt;ul&gt;&lt;a href=\"http://goo"; print $text . "\n"; print _filter_htmlcorrector($text) . "\n";'


And for me the results are:

&lt;ul&gt;&lt;a href="http://goo
&lt;ul&gt;&lt;a href="http://goo&lt;/ul&gt;


(The second line is the output of _filter_htmlcorrector().)

It would be worth seeing if there's an issue for this already, and if not creating one. I find the built-in HTML corrector too limiting anyway (it always strips styles for example IIRC), and use htmLawed. With that you get:

drush php-eval '$text = "&lt;ul&gt;&lt;a href=\"http://goo"; print $text . "\n"; print htmLawed_filter('process', 0, -1, $text) . "\n";'


Results:

&lt;ul&gt;&lt;a href="http://goo
&lt;ul&gt; &lt;/ul&gt;


(Again, second line is the cleaned output - it's simply stripped the incomplete tag.)