[pmwiki-users] \\L LinkPattern Replace in Markup Rules

Patrick R. Michaud pmichaud at pobox.com
Tue Oct 18 07:50:18 CDT 2005


On Tue, Oct 18, 2005 at 02:39:08PM +0200, Sebastian Siedentopf wrote:
> I want to do some (x)ajax stuff on a wiki and did some testing. First  
> I just want to output the content of a wikipage and everything seems  
> to be ok except the links. Every single word becomes a wiki link in  
> the output.
> 
> The problem seems to be the \\L tag in the markup rules. Why do we  
> the replace
> 
>  $MarkupRules[str_replace('\\L',$LinkPattern,$m['pat'])]=$m['rep'];
> 
> in the BuildMarkupRules() and not earlier (e.g in Markup())?

...because $LinkPattern doesn't exist at the time that calls to
Markup() is being made.  More to the point, the value of $LinkPattern
can't be determined until *all* site customizations have been loaded,
and since site customizations make calls to Markup(), $LinkPattern
has to be inserted into the rules at a later time.  Thus, PmWiki
does the replacements of $LinkPattern in BuildMarkupRules(), which
is in charge of updating all of the pattern -> replacements as
a first step of MarkupToHTML().

However, I suspect the problem has nothing to do with $LinkPatterns
or the \L, as these are used only for *external* links.  WikiWord
and other page links are handled by other markup rules that don't
make use of \L.

Pm




More information about the pmwiki-users mailing list