[pmwiki-users] Markup Expression parameters

Hans Bracker design at softflow.co.uk
Mon Sep 28 05:59:12 CDT 2015


Trying to write a markup expression, I am having trouble getting the
whole unaltered string from a PTV into my ME function.
Only strings in double quotes do not get altered (but the double
quotes get stripped, which I guess is okay).
Otherwise PmWiki uses KeepTokens (if $params is used)
and strips single quotes.
I used both $params and $args to capture the string,
with similar results.
OTOH displaying  a PTV does not change anything.

Here is a test markup expression, and a test page content:

//for testing
$MarkupExpr['fixptv'] = 'FixPtv($params)';
function FixPtv($a) {
        print_r($a); echo "<br/>";
        $r = (is_array($a)) ? implode(" ",$a) : $a;
        return $r;
}

//in wiki page
Music1: Classical, "Rhythm & Blues", "Rock'n'Roll"
as M.E.: {(fixptv {$:Music1})}
as PTV: {$:Music1}

Music2: Classical, Rhythm & Blues, Rock'n'Roll
as M.E.: {(fixptv {$:Music2})}
as PTV: {$:Music2}

Music3: Classical,Rhythm & Blues,Rock'n'Roll
as M.E.: {(fixptv {$:Music3})}
as PTV: {$:Music3}

Is there a way to get the PTV string unaltered into the function, for
further manipulation there, including quotes?

thanks
 Hans      




More information about the pmwiki-users mailing list