[pmwiki-users] Simple markup question...

The Editor editor at fast.st
Wed Sep 20 12:05:58 CDT 2006


What I meant was I thought of trying to add a NEW (custom) markup rule
modeled on the [= =] rule, not that I would replace [= =] or in any
way change its functionality.

My obstacle was I could not figure out how to write it so the new
markup rule would be triggered by (:keep text:).  That being the
syntax I thought might work me, for this specific situation.

     Markup('keep','>{$var}',"/(\n[^\\S\n]*)?\\[([=@])(.*?)\\2\\]/se",
         "PreserveText('$2', PSS('$3'), '$1')");

I changed the timing and name of it, but how do I change [= and =] to
(:keep and :)? The expression matching in this markup in particular is
quite complex.

Cheers,
Caveman



On 9/20/06, Patrick R. Michaud <pmichaud at pobox.com> wrote:
> On Wed, Sep 20, 2006 at 12:38:02PM -0400, The Editor wrote:
> > Oops meant to send this to the list...
> >
> > On 9/20/06, Patrick R. Michaud <pmichaud at pobox.com> wrote:
> > > In other words, you want to replace {$FieldName} by its contents
> > > but not process any other markup that comes in as a result.
> >
> > exactly
> >
> > > PmWiki doesn't have anything like that built-in, you'll have to
> > > have some custom code to do it.  Which means that you either need
> > > a custom markup that means "replace page variables but Keep() the
> > > results", or a custom page variables that return text as escaped
> > > values using Keep().
> >
> > I prefer the first option.  The second one won't work really for other reasons.
> >
> > I  tried using the [= =] rule as a basis for a keep rule, and changed
> > the timing of it.
>
> Well, that's counter-intuitive to what authors expect, or at
> least what we tell them.
>
> We tell authors that [=...=] and [@...@] always preserve their contents
> from any markup processing.  Thus, if an author writes [={$var}=],
> then she has an absolute right to expect that she will see "{$var}"
> (i.e., curly-dollar-v-a-r-curly) in the output and not the contents of
> some page variable.
>
> Pm
>




More information about the pmwiki-users mailing list