[pmwiki-users] How to prevent text from being parsed?

Patrick R. Michaud pmichaud at pobox.com
Sat Jan 21 08:45:27 CST 2006


On Sat, Jan 21, 2006 at 12:12:07PM +0100, Musikschule Bernsbach / Schwarzenberg (Webmaster) wrote:
> Thank you all for your help. :-)
> I think Patrick's solution is the best one for me.
> 
> 
> Greetings, Torsten
> 
> 
> -----Urspr?ngliche Nachricht-----
> Von: pmwiki-users-bounces at pmichaud.com
> [mailto:pmwiki-users-bounces at pmichaud.com] Im Auftrag von H. Fox
> Gesendet: Freitag, 20. Januar 2006 23:30
> An: Patrick R. Michaud
> Cc: pmwiki-users at pmichaud.com
> Betreff: Re: [pmwiki-users] How to prevent text from being parsed?
> 
> On 1/20/06, Patrick R. Michaud <pmichaud at pobox.com> wrote:
> > At the moment the best way is to force a block designation on it:
> >
> >     Markup(
> >       'html',
> >       'fulltext',
> >       '/^\\(:html:\\)(.*?)\\(:htmlend:\\)/esi',
> >       "'<:block>'.Keep(str_replace(array('&gt;', '&lt;', '&amp;'),
> >                                    array('>', '<', '&'), PSS('$1')))");
> 
> Using that, the source including (:html:) appears in the rendered
> page.  I traced it down to the ^ in
> 
>       '/^\\(:html:\\)(.*?)\\(:htmlend:\\)/esi',
> 
> If I take out the ^ it seems to work.

Oh yes, I forgot to add the /m option to the pattern so that the ^ would
work, thus:

    Markup(
      'html',
      'fulltext',
      '/^\\(:html:\\)(.*?)\\(:htmlend:\\)/esim',
      "'<:block>'.Keep(str_replace(array('&gt;', '&lt;', '&amp;'),
                                   array('>', '<', '&'), PSS('$1')))");

> > However, it occurs frequently enough (for me as well) that I'm
> > thinking I'll add a 'B' (block) pool to the Keep() function that
> > indicates the kept content is block markup and therefore should not
> > be wrapped in a paragraph.  [...]
> >
> > Or perhaps just a KeepBlock() function that does the equivalent.
> 
> Either one of those would be helpful.

Actually, I'm now thinking that perhaps I'll make Keep() smarter --
it will scan the string for block markups and automatically place
the string into the 'B' pool unless overridden to be in a different
one.

Pm




More information about the pmwiki-users mailing list