[Pmwiki-users] transforming + / - lists to *
Patrick R. Michaud
pmichaud
Mon Jun 14 08:30:28 CDT 2004
On Mon, Jun 14, 2004 at 11:29:26AM +0200, Knut Alboldt wrote:
> Is there an easy way to transform
> +
> ++
> +++
> etc at the beginning of a line to something like
> * %green%
> ** %green%
> *** %green%
>
> Can this be done by using Double-Brackets or inlinereplacement (in pmwiki
> v1.x) ?
$DoubleBrackets['/^(\\++)/e'] =
"str_replace('+','*','$1').' %green%'";
$DoubleBrackets['/^(-{1,3})/e'] =
"str_replace('-','*','$1').' %red%'";
Note that I've limited '-' to three levels, since '----' at the
beginning of a line is used for horizontal rules.
Pm
More information about the pmwiki-users
mailing list