[dokuwiki] Re: Search Result

Try this at the 3rd line of ft_snippet()

    //$text     = rawWiki($id);
    $search = array('@<script[^>]*?>.*?</script>@si', // javascript
      '@<style[^>]*?>.*?</style>@siU',                // style tags
      '@<[\/\!]*?[^<>]*?>@si',                        // HTML tags
      '@<![\s\S]*?--[ \t\n\r]*>@',                    // multi-line comments
      '@\s+@'                                         // extra whitespace
      );
    $text = html_entity_decode(preg_replace($search,' 
',p_wiki_xhtml($id)),ENT_QUOTES);

This could be simplified (and faster) if I was sure that there were no 
javascript or comment blocks. But remember that this is only done when 
search results are displayed, and the underlying rendered xhtml is already 
cached.

Todd Augsburger
todd@xxxxxxxxxxxxxxxx
Roller Organs
www.rollerorgans.com

--------------------------------------------------
From: "Jacob Steenhagen" <jacob@xxxxxxxxxxxxx>
Sent: Tuesday, February 26, 2008 3:33 PM

So, based on my incomplete understanding of the DokuWiki codebase, IMHO the
better option (even though it's more work) is to create a plain text
renderer and create snippets from that.
 

-- 
DokuWiki mailing list - more info at
http://wiki.splitbrain.org/wiki:mailinglist

Other related posts: