[pmwiki-users] How to pass markup values to function . . .
Patrick R. Michaud
pmichaud at pobox.com
Tue Feb 8 16:24:56 CST 2005
On Tue, Feb 08, 2005 at 03:49:02PM -0600, Ben Wilson wrote:
> On Tue, 08 Feb 2005 18:33:39 +0100, Knut Alboldt <pmwiki at alboldt.de> wrote:
> > Ben Wilson schrieb:
> > > (:thismarkup key=value:)
> > >
> > > And I want to pass the key=value to a function where the values can
> > > the be put into form fields. How can I pass the values?
When using the /e option on the pattern match, it's a good idea in
general to make sure that the replacement pattern is in double quotes,
and that any parameters are passed to the PSS() function if they're
likely to have quotes or backslashes in them. Thus, the call to markup
should probably be
Markup('testgetarg','directives',
'/\\(:testgetarg\\s*(.*?)\\s*:\\)/e',
"TestGetArg('$1')");
or if the arguments are likely to have quotes in them...
Markup('testgetarg','directives',
'/\\(:testgetarg\\s*(.*?)\\s*:\\)/e',
"TestGetArg(PSS('$1'))");
Pm
More information about the pmwiki-users
mailing list