On 2015-09-28 12:59, Hans Bracker wrote:
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.

In Markup expressions quoted strings are considered parameters; moreover there may be nested expressions which complicates things.

as M.E.: {(fixptv {$:Music1})}

When markup expressions are processed, PmWiki actually sees here:
  {(fixptv Classical, "Rhythm & Blues", "Rock'n'Roll")}

i.e. at that point the PTV is already expanded to its value; then the markup expression function parses and escapes the parameters to allow nested expressions and processes the string as many times as there are nested expressions.

If your value contains parentheses like "(pop)rock" this will be considered another Markup expression and will be further escaped.

To get the unaltered value of the variable, maybe you could write this like {(fixptv $:Music1)} without the internal set of braces. Then your function can call PageTextVar() to get the value.

Petko

--
Change log     :  http://www.pmwiki.org/wiki/PmWiki/ChangeLog
Release notes  :  http://www.pmwiki.org/wiki/PmWiki/ReleaseNotes
If you upgrade :  http://www.pmwiki.org/wiki/PmWiki/Upgrades


_______________________________________________
pmwiki-users mailing list
[email protected]
http://www.pmichaud.com/mailman/listinfo/pmwiki-users

Reply via email to