[pmwiki-users] Release: GoogleMapsInterface

Patrick R. Michaud pmichaud at pobox.com
Wed Dec 6 14:01:00 CST 2006


On Wed, Dec 06, 2006 at 01:45:43PM -0500, Craige Leeder wrote:
> Hans wrote:
> >to avoid the necessary space at (:map-end :)
> >you could try this regex instead:
> >
> >'/\(:map(-location|-end)\\s*(.*?):\)/ie'

Actually, the markup you're looking for is probably
something like:

  Markup('map', '_begin', 
    '/\\(:map(-location|-end)(\\s.*?)?:\\)/ie',
    "CvtMarkup('$1', PSS('$2'))");

The \s* approach above doesn't require the space (since \s*
will match an empty string), so what we really want is a
required space (i.e., \s) before any options.

Also, I should note that performing this markup at the '_begin'
stage of processing is *really* early -- in particular, it occurs
even before escapes ([=...=] and [@...@]) are processed.
At the very least I'd recommend that it be moved to occur
at some point after the escape markups:

  Markup('map', '>[=', 
    '/\\(:map(-location|-end)(\\s.*?)?:\\)/ie',
    "CvtMarkup('$1', PSS('$2'))");

I'd also recommend a function name other than "CvtMarkup".  :-)

Pm




More information about the pmwiki-users mailing list