[pmwiki-users] Disabling WikiWords in custom markup
Patrick R. Michaud
pmichaud at pobox.com
Wed Dec 14 11:30:07 CST 2005
On Wed, Dec 14, 2005 at 09:15:07AM -0800, Jeff Ullmann wrote:
>
> I am trying to create a Markup that will take something like
>
> _av_Click
> Here|MFNGOfferNoShare|1|mfngPID=1019&mfngCID=18452&mfngNetCN=123063&mfngTitl
> eName=Alicia%20Keys%20-%20I%20dont%20like%20to%20share|_av_
>
> And insert
>
> <a
> href='javascript:window.top.Navio.Buy("MFNGOfferNoShare","1","mfngPID=1019&m
> fngCID=18452&mfngNetCN=123063&mfngTitleName=Alicia%20Keys%20-%20I%20dont%20l
> ike%20to%20share");'>Click Here</a>
>
> Into a wiki page.
>
> I have some markup that works with one exception. Element 2,
> "MFNGOfferNoShare", is getting treated as a WikiWord, which of course breaks
> the link I'm trying to create.
>
> The markup I've tried is relatively simple
>
> Markup('av','inline',
> "/(?>_av_([^|]+)[|]([^|]+)[|]([^|]+)[|]([^|]+)_av_)/",
> "[=<a
> href='javascript:window.top.Navio.Buy(\"$2\",\"$3\",\"$4\");'>$1</a>=]");
>
> Any thoughts or suggestions?
The [=...=] markup is handled very early in the processing sequence, so
it's not really providing any protection here. You probably want to use
Keep(), although keeping track of all of those nested quotes is going
to be a real pain. Maybe:
Markup('av','inline',
"/(?>_av_([^|]+)[|]([^|]+)[|]([^|]+)[|]([^|]+)_av_)/e",
"Keep('<a href=\\'javascript:window.top.Navio.Buy(\"$2\",\"$3\",\"$4\");\\'>$1</a>')");
Pm
More information about the pmwiki-users
mailing list