[pmwiki-users] Markup

Patrick R. Michaud pmichaud at pobox.com
Fri Mar 3 07:04:32 CST 2006

On Fri, Mar 03, 2006 at 01:04:29PM +0100, a.steenveld at id.umcn.nl wrote:
> > From: Patrick R. Michaud [mailto:pmichaud at pobox.com]
> > I think you really want a custom markup.  My suggestion would be
> > to redefine "[top]" as a shortcut:
> > 
> >     Markup('[top]', '<links',
> >       '/(?<!\\[)\\[top\\]/', 
> >       '[[#top | top]]');
> I don't think you have to escape the closing square brase (\\]), It has no 
> special meaning atached to it since the opening one is already escaped.

You're correct, but I try to err on the "safe side" when
writing such things.  Without the escape I have to think "hmm, 
I wonder if that bracket will be treated as a metacharacter", 
with the escape I can be certain it will work without having to
think about it a lot.


More information about the pmwiki-users mailing list