All Low add-ons are now owned by EEHarbor. Read the blog post.

Support archive

Multiple spaces in excerpt

AboutWout 9 Oct 2011 22:18 problem, rejected

Hi Low,

I've come across a few cases now where the search excerpt contains a lot of consecutive spaces (due to malformed content contains nbsp's), but I'd like to have my search results nice an clean.

I've tweaked the excerpt creation a little bit to achieve this...

On line 548 of ext.low_search.php I added the following:

$str = preg_replace('/( |\s)+/', ' ', $str);

Which basically checks for spaces and tabs and replaces them with a single space. The resulting excerpts are a lot cleaner.

– Wouter

Replies

  1. Low 10 Oct 2011 07:38

    Hey Wouter,

    I'm just gonna mark this as "not a problem", but I'll consider it a filed feature request. Consider it added to the core for the next version. :)

  2. AboutWout 10 Oct 2011 07:44

    No problem ;)