[pmwiki-users] BUG in wiki link parsing

Patrick R. Michaud pmichaud at pobox.com
Tue Feb 22 22:19:04 CST 2005


On Tue, Feb 22, 2005 at 07:15:50PM -0500, Leo wrote:
> Hi Everyone,
> I just noticed that the following WikiLink is NOT properly parsed
>    [[Some Link [2005] -> Some Link]]
> while 
>    [[Some Link (2005) -> Some Link]]
> is parsed correctly.

The code doesn't like to see square brackets (actually, any ']') before 
the ->, because then it cannot easily parse:

   [[Some link]]  with text intervening and [[another link -> another page]]

PmWiki interprets all of the above as being a single link to
Another Page with a link text of "Some link]] with text intervening
and [[another link".  Although it's very easy to exclude a single
character such as ']' in a regular expression, it's a bit more difficult
to write a regular expression that excludes a sequence of two or more
characters such as ']]'.

One workaround is to use a character entity for the ']', as in:

   [[Some Link [2005] -> Some Link]]

I admit this is ugly.  Another way is to use the '|' form of link,
as in

    [[Some Link | Some Link [2005] ]] 

This works fine.

If you still need ']' to work in -> links, I'll work on it.

Pm



More information about the pmwiki-users mailing list