Page 1 of 1

Search results featuring broken tags

Posted: Thu Jul 10, 2008 10:07 pm
by Cohnina
Blog: http://www.pegasustraum.de/serendipity/
Serendipity version: 1.3.1

We have a very nasty problem - if you search for "katze" in the blog, you will see the list of results. At the end we get a broken <img>-Tag in the html output.

The corresponding website source code:

Code: Select all

<br>
hoffentlich wirst du bald wieder gesund und kannst dich um eure katze kümmern, bevor sie die wohnung zerlegt <img ...=""></li>
Somehow the <img> Tag get's broken; which plugin or function truncates the comments in the search results? Sometimes this truncation leads to a totaly misformed blog page as images in the comments get messed up.

Re: Search results featuring broken tags

Posted: Fri Jul 11, 2008 11:12 am
by garvinhicking
Hi!

Inside the plugin_commentsearch_searchresults.tpl you can find the line:

Code: Select all

{$result.comment|@truncate:200:" ..."}
This is responsible for the truncation. You might want to change that to:

Code: Select all

{$result.comment|@strip_tags|@truncate:200:" ..."}
To remove all HTML entities before stripping. Or you remove the 'truncate' option to display the whole comment.

Regards,
Garvin

Re: Search results featuring broken tags

Posted: Sat Jul 12, 2008 9:33 pm
by Cohnina
garvinhicking wrote:

Code: Select all

{$result.comment|@strip_tags|@truncate:200:" ..."}
To remove all HTML entities before stripping. Or you remove the 'truncate' option to display the whole comment.
Thanks for the advice - it works now like desired :-) We simply switched off the comments truncation as in our blog the comments are not so long that they need to be truncated.