[pmwiki-users] MarkupExpressionsExtensions

Patrick R. Michaud pmichaud at pobox.com
Thu Apr 19 13:14:08 CDT 2007


On Thu, Apr 19, 2007 at 01:47:28PM -0400, The Editor wrote:
> On 4/19/07, Patrick R. Michaud <pmichaud at pobox.com> wrote:
> >On Wed, Apr 18, 2007 at 04:38:16PM -0400, The Editor wrote:
> >> > $MarkupExpr['wiki'] = 'MkExpExtWiki($params)';
> >
> >In the comments at the top of markupexpr.php, it reads:
> >
> >    Finally, if the code in $MarkupExpr contains '$params', then
> >    it is executed directly without any preprocessing into arguments,
> >    and $params contains the entire argument string.  Note that $params
> >    may contain escaped values representing quoted arguments and
> >    results of other expressions; these values may be un-escaped
> >    by using "preg_replace($rpat, $rrep, $params)".
> 
> $rpat and $rrep need to be declared global in the extension function I 
> presume?

Use it in the ME definition itself: 

    $MarkupExpr['wiki'] = 'MkExpExtWiki(preg_replace($rpat, $rrep, $params))';

Look at the way that $MarkupExpr['pagename'] is defined in
scripts/markupexpr.php for an example.

> >At present I don't have any plans to change the way that PmWiki
> >escapes (:pagelist ...:) in the core.
> 
> It would be very nice to be able to accurately store pagelists in
> PTV's.  

The phrase "store pagelists in PTV's" doesn't quite make sense
to me.  Exactly what text do you want the page text variable to
contain?

Pm



More information about the pmwiki-users mailing list