Search results featuring broken tags

Random stuff about serendipity. Discussion, Questions, Paraphernalia.
Post Reply
Cohnina
Regular
Posts: 30
Joined: Fri Oct 05, 2007 12:11 pm
Location: Aldenhoven
Contact:

Search results featuring broken tags

Post 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.
garvinhicking
Core Developer
Posts: 30022
Joined: Tue Sep 16, 2003 9:45 pm
Location: Cologne, Germany
Contact:

Re: Search results featuring broken tags

Post 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
# Garvin Hicking (s9y Developer)
# Did I help you? Consider making me happy: http://wishes.garv.in/
# or use my PayPal account "paypal {at} supergarv (dot) de"
# My "other" hobby: http://flickr.garv.in/
Cohnina
Regular
Posts: 30
Joined: Fri Oct 05, 2007 12:11 pm
Location: Aldenhoven
Contact:

Re: Search results featuring broken tags

Post 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.
Post Reply