[pmwiki-users] Markup tag in rule script is not processed (pmwiki-users Digest, Vol 26, Issue 42)

John Rankin john.rankin at affinity.co.nz
Thu Aug 16 21:16:28 CDT 2007


On Friday, 17 August 2007 5:00 AM, pmwiki-users-request at pmichaud.com wrote:
>   3. Markup tag in rule script is not processed (Richard Haven)
>Message: 3
>Date: Wed, 15 Aug 2007 10:30:55 -0700
>From: "Richard Haven" <richard at gbox.com>
>Subject: [pmwiki-users] Markup tag in rule script is not processed
>
>cookbook/my.php:
>
><?php if (!defined('PmWiki')) exit ();
>
>Markup('buy', '<img', "/\\(:buy (.*?)\\s*:\\)/e",
>"AddToCart('$1')");
>
>Markup('Buy', '<img', "/\\(:Buy (.*?)\\s*:\\)/e",
>"AddToCart('$1')");

I think the problem is the sequence; try changing '<img' to 
'directives'. You probably also want "AddToCart(PSS('$1'))".

'img' is evaluated in the middle of evaluating links, and
you probably want to get the buy processing out of the
way and inside a Keep before PmWiki strikes something that
could be interpreted as a link.
>
>
>gives:
>
>(:Buy Basic Offer
><http://april.navio.com/wiki/index.php/Profiles/BasicOffer?action=edit>
>?
><http://april.navio.com/wiki/index.php/Profiles/BasicOffer?action=edit>
>:)
>
>Any suggestions for debugging ?
>
>Thanks


-- 
JR
--
John Rankin

       \_      
        \)   
         \,\__/7
         /    /
        (   c'
         \  / 
     /,  /_/  
    |  & *   Wellington
    )  /    
   /  /,    
  /  (    
 |   /      
 \__/       
   V        






More information about the pmwiki-users mailing list