[Pmwiki-users] Re: PmWiki 2 questions

Patrick R. Michaud pmichaud
Mon Sep 20 20:57:26 CDT 2004

On Tue, Sep 21, 2004 at 01:54:38PM +1200, John Rankin wrote:
> Um, what about starting with the obvious:
> Change the MakeLink function as follows
> else {
>   if (is_null($txt)) {
>     ...
>   } else
>     $txt = MarkupToHTML($txt);

> Would that work? The following would cause problems:
> [[a page | !link text with a WikiWord]]
> How worried should one be about extreme cases?

I dunno.  I think I somehow feel better about saying that inline markups are
processed in link text rather than making the recursive call to MarkupToHTML.
The case above definitely has a problem that the recursive call to 
MarkupToHTML would convert "WikiWord" in the link text to a link, as
well as the header problem.  One can get rid of the header problem with

   $txt = MarkupToHTML($pagename,"[==]$txt");

but it still seems a bit too hackish for me.  And we'd also have to take
care of processing & correctly, which is do-able but definitely
something to watch.  

Overall it just seems cleaner to handle inline markup before the link
markup.  We can also run into issues with markup text like
[[a ''page'']].  I suspect it would be easier to fix MakeLink
and/or LinkPage to handle cases like this than it would to do the
recursive call.  (Essentially MakeLink strips out any HTML tags it 
finds in the target before building the page name from what is left.)

Which of the extended markups (Cookbook.MarkupExtensions) would cause 
problems if they were processed before links?  A quick glance seems
that -> is the only difficult one--but this one could be resolved by
processing it after block markup (where it currently occurs).

After looking at this I'm increasingly of the opinion that maybe we
should just try moving inline markups before link processing and
see what breaks.  So, for testing purposes I've gone ahead and
set a local customization on 


so that the markup processing sections are

   _begin, fulltext, split, directives, inline, links, block, style, _end.

I've also enabled extendmarkup.php on that page.  I've also modified
MakeLink so that it strips any HTML tags it finds in the target before
determining the target link.  Let's see what breaks and what doesn't.

Note that this still doesn't enable WikiStyles in link text -- that one
is definitely a tougher nut to crack.


More information about the pmwiki-users mailing list