[pmwiki-users] custom markup: passing arguments to function

Dominique Faure dominique.faure at gmail.com
Mon Jun 16 09:04:23 CDT 2008


On Mon, Jun 16, 2008 at 15:30, Anno <anno at shroomery.org> wrote:
> Hans wrote:
>> Monday, June 16, 2008, 12:53:57 PM, Anno wrote:
>>
>>> Markup('jslide', 'end_',
>>> '/\\(:jslide\\s"(.*)"\\s"(.*)"\\s"(.*)":\\)/e',
>>> "jslide('$1','$2','$3')");
>>
>> try this:
>>
>> Markup('jslide', 'end_',
>>  '/\\(:jslide\\s+(.*?)\\s+(.*?)\\s+(.*?)\\s*:\\)/e',
>>  "jslide(PSS('$1'),PSS('$2'),PSS('$3'))");
>>
>>
>>
>>   ~Hans
>
> No, nothing. Does it work at your site?
>
> Anno
>

IMHO, this is due to the fact that the '.' regexp placehoder is also
capturing '\s'.
You sould perhaps use the ParseArgs function to handle your markup parameters:

Markup('jslide', 'end_',
  '/\\(:jslide\\s+(.*?)\\s*:\\)/e',
  "jslide_markup(PSS('$1'))");

function jslide_markup($args) {


-- 
Rodney Dangerfield  - "I haven't spoken to my wife in years. I didn't
want to interrupt her."



More information about the pmwiki-users mailing list