[pmwiki-devel] Redirect Markup question

Hans design5 at softflow.co.uk
Sun Jan 27 12:15:26 CST 2008


I found an odd behaviour of the (:redirect PageName:) markup:

I am working on further improvement of highlighting search terms
using the 'extract' markup expression (Cookbook.TextExtract).

When using case-insensitive search with term 'page' a text line like

   [@(:redirect PageName:)@]

is replaced with

   [@(:redirect @]'''Page'''Name[@:)@]

This works for all kinds of directives just fine, but fails with the
(:redirect :) markup.

It seems that the markup is evaluated, the RedirectMarkup function is
called, and returns

   Keep("(:redirect @]'''Page'''[@Name:)");

which prevents the  '''Page''' markup from being rendered and
the line is shown as

  (:redirect @]'''Page'''[@Name:)

I do not understand why the RedirectMarkup function is called,
and why the function returns a Keep( ...) instead of the plain markup
string  "(:redirect $opt:)"

Without the call to  Keep() the generated text line

   [@(:redirect @]'''Page'''[@Name:)@]

will display fine with bold 'Page' and escaped markup.

  ~Hans   




More information about the pmwiki-devel mailing list