From the Eliovir

Pm Wiki: Markup Expressions-Talk

This is a talk page for improving MarkupExpressions.


Requests for further markup expressions

# return substring of string before targetstring:
##  expressions like {(stringbefore string targetstring)}
$MarkupExpr['stringbefore'] = 'stringbefore($args[0],$args[1])';

function stringbefore($text,$target)
{
  list($text2,$null) = explode($target,$text);
  return $text2;
}

Q how do I achieve the following

Use {(substr "string" -n)}
Use {(substr "string" 0 -n)}

Working examples

* "{$Name}"
# {(substr "{$Name}" 6 -5)}
# {(substr "{$Name}" -5)}
# {(substr "{$Name}" 0)}

# {(substr "{$Name}" 0 -5)}
# {(substr "{$Name}" -5 4)}
# {(substr "{$Name}" -5 -6)}
  • “MarkupExpressions-Talk”
  1. Expressions
  2. -Talk
  3. MarkupExpressions-Talk
  4. MarkupExpressions
  5. -Tal

Is it possible to nest markup expressions?

looks like the answer is no
{(substr "{$FullName}" 0 -5)}

{(asspaced '{$FullName}')}

{(asspaced '{(substr "{$FullName}" 0 -5)}')}

PmWiki.MarkupExpressions

Pm Wiki.Markup Expressions-Talk

(asspaced ‘{PmWiki.MarkupExpressions’)}

Copyright © 2005–2025 the Main wiki and its authors

Retrieved from http://eliovir.free.fr/index.php5/PmWiki/MarkupExpressions-Talk

Page last modified on June 11, 2009, at 03:04 AM EST