htmlcorrector does not fix teaser?

livingegg - January 7, 2009 - 18:09
Project:HTML corrector
Version:5.x-1.x-dev
Component:Code
Category:support request
Priority:normal
Assigned:Unassigned
Status:active
Description

My site has teasers that get trimmed in such a way that closing tags are getting cut off, which in turn is breaking my theme. I searched extensively and found that in Drupal 5, the htmlcorrector module can solve this problem. However, from what I have seen this module only creates a filter to close any unclosed tags when a node is submitted, but it does not address the teaser problem. Is this correct, or am I just misunderstanding something? Thanks.

#1

trevorleenc - February 13, 2009 - 22:24

I'm having this problem too :(

#2

ajevans85 - February 16, 2009 - 12:25

Since the drupal node_teaser function trims text you would of thought that it would try to keep valid xml structure instead of just cutting off the closing tags.

As a work around I would create a custom template for your nodes and each time you want a teaser displayed (as long as htmlcorrector is installed) is use the below in your template:

print _htmlcorrector_process($node->teaser);

I have add to copy the _htmlcorrector_process function out of the module into my Drupal 6 template.php to achiev the same.

#3

geme4472 - March 7, 2009 - 17:22

Unless I misunderstand the question, which is probably the case, I think you need to regen your teasers once the htmlcorrector filter is installed (module turned on, filter added to any of your input formats). Since the teaser is stored in the database, all your old nodes' teasers have yet to go through the htmlcorrector processing. An edit or new node creation will confirm that the corrector is working as it is supposed to. There's also a module that can regen all those for you... looking... http://drupal.org/project/retease

#4

pribeh - May 5, 2009 - 18:44

Hey,

Thanks for this great module. I'm having a similar problem. I'm trying to use the drupalicious_summarise code (displayed below) under an 'if teaser' statement but can't figure out how to apply the _htmlcorrector_process, as mentioned in #2, to it. The drupalicious code keeps breaking tags in teasers. Here's the code:

<?php print drupalicious_summarise($content,20);?>

#5

ajevans85 - May 6, 2009 - 09:39

How about

<?php
print _htmlcorrector_process(drupalicious_summarise($content,20));
?>

#6

pribeh - May 6, 2009 - 16:24

Works great! thanks a bunch.

 
 

Drupal is a registered trademark of Dries Buytaert.