[pmwiki-users] Highlighting Pagelist Results [was:Recipe Update: Fox]

Hans design5 at softflow.co.uk
Tue Jan 29 10:47:00 CST 2008


Tuesday, January 29, 2008, 2:29:29 PM, The Editor wrote:

> 1) When doing a case insensitive search--I get the matches in the
> search function, but not the display.

I have the /i qualifier switched for all preg match and replace calls.

> 2) When doing a boolean like apples && oranges--I also get the matches
> but not the display

apples & oranges would need to be entered as regex: apples|oranges

> 3) When searching for a phrase I get false matches. IE pages with the
> words--but not the phrase

can this be because you apply wordboundary character \b ?

> 4) What to do with markup. Right now, my returns show the markup.
> Processing it causes problems. Perhaps it could get stripped out to
> some extent.

I have no option top show active markup directives and active markup
expressions, since the results were too horrible.
Either lines containing directives are ignored, which will give
perhaps some missing results, or the directives and expressions are
shown as code. The latter is the default and looks acceptable when
doing for instance searches in the PmWiki documentation.

> 5) How do I block results where the term happens to be in the markup
> (like a link for example)

I do not block it, but show it as code, with the term being
highlighted. Or lines with markup directives are cut and not leading
to results.

By far the most tricky bit is how to treat various directives, and how
to get the highlight right when the term is in a code escape markup
like [@ ... term ...@] or [= ...term ...=] or some worse cases.

If you look at extract.php function TextExtract case 'code'
you see a number of replacements are happening for various reasons to
defuse some active markups. It still fails in a few cases, but works
for most. PmWiki.ChangeLog is a great page to use as a source for
testing, full of weird markup!


  ~Hans




More information about the pmwiki-users mailing list