[pmwiki-users] Disabling WikiWords in custom markup

Jeff Ullmann JeffUllmann at navio.com
Wed Dec 14 16:58:43 CST 2005


Thank you for the suggestion, but that didn't seem to work either.  Maybe
this can't be done or I just haven't found the right recipe(s) to borrow
from.  I'll have to revisit it when I have some more free time.

Basically I'm trying to take 4 pieces of data and output a javascript link
in the resulting page, while at the same time avoiding have to become an
expert in YAL. 

jU?

Sample Data:

Link Description=Alicia Keys
Name=MFNGOfferNoShare
Quantity=1
ID=ngTitleName=Alicia%20Keys%20-%20I%20dont%20like%20to%20share

Required Result:
<a
href='javascript:window.top.Navio.Buy("MFNGOfferNoShare","1","ngTitleName=Al
icia%20Keys%20-%20I%20dont%20like%20to%20share");\\'>Alicia Keys</a>


Navio Systems, Inc.

-----Original Message-----
From: Patrick R. Michaud [mailto:pmichaud at pobox.com] 
Sent: Wednesday, December 14, 2005 9:30 AM
To: Jeff Ullmann
Cc: pmwiki-users at pmichaud.com
Subject: Re: [pmwiki-users] Disabling WikiWords in custom markup

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&mf
> Here|MFNGOfferNoShare|1|ngTitl
> 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%20do
> nt%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
-------------- next part --------------
A non-text attachment was scrubbed...
Name: smime.p7s
Type: application/x-pkcs7-signature
Size: 3133 bytes
Desc: not available
Url : /pipermail/pmwiki-users/attachments/20051214/7fcbf760/attachment.bin 


More information about the pmwiki-users mailing list