[pmwiki-users] Custom Markup: $2 does not work correctly (regexp problem?)

Dawid Gajownik gajownik at gmail.com
Mon Aug 28 16:27:39 CDT 2006

Dnia 08/25/2006 03:21 PM, Użytkownik Patrick R. Michaud napisał:
> The '|' has meaning in a regexp (it's an alternation), so I think
> what you likely intended is:
> Markup("boxfile", "block", 
>   '/\\(:boxfile (.*?) \\| (.*?):\\)/s', 
>   "<div class=\"boxfile\"><p><strong>File:</strong> $1</p><pre>$2</pre></div>");

Thanks, this works, too, although it does not disable PMWiki markup in 
<pre></pre> part.

> Also note that it won't be able to handle multiple lines in the
> markup (the /s option on the pattern), because 'block' occurs 
> after PmWiki has split the input text into separate lines 
> and is in line-by-line processing mode.

Thanks once again for the good explanation!




More information about the pmwiki-users mailing list