[dokuwiki] Re: Broken search highlighting?

  • From: "Todd Augsburger" <todd@xxxxxxxxxxxxxxxx>
  • To: <dokuwiki@xxxxxxxxxxxxx>
  • Date: Wed, 5 Mar 2008 09:54:11 -0500

I was attempting a search on a phrase which included part of a wiki table,
such as:
   "| Row 1 Col 1"

The found links, such as:
   http://wiki.splitbrain.org/wiki:syntax?s=%5C%7C%20royw%201%20col%201
don't render properly, sometimes returning partial garbage, sometimes not
rendering at all. This appears to happen because of the pipe character.

It seems to me that it would be best to split all the words, and assure that there were no pipes at the beginning or end, like this (inc/html.php):

function html_hilight($html,$regex){
 // strip everything that's special except pipes:
 //$regex = preg_replace('![\[\]()/\\\\?\.+*]+!','',$regex);
$regex = preg_replace(array('![\W]+!','!(^\|)|(\|$)!'),array('|',''),$regex);


Todd Augsburger
todd@xxxxxxxxxxxxxxxx
Roller Organs
www.rollerorgans.com
--
DokuWiki mailing list - more info at
http://wiki.splitbrain.org/wiki:mailinglist

Other related posts: