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

Patrick R. Michaud pmichaud at pobox.com
Fri Jan 20 12:33:55 CST 2006


On Fri, Jan 20, 2006 at 10:42:19AM -0700, H. Fox wrote:
> On 1/20/06, Patrick R. Michaud <pmichaud at pobox.com> wrote:
> > On Fri, Jan 20, 2006 at 02:22:00PM +0100, Musikschule Bernsbach / Schwarzenberg (Webmaster) wrote:
> > > Hi...
> > >
> > > In the cookbooks and in the mailing list archives
> > > I haven't found anything that can help me.
> > >
> > > I want some content NOT being parsed and translated
> > > in the PmWiki way, but written directly to the browser.
> > >
> > > The idea is to define an directive, which inner text is
> > > the direct output:
> [...]
> > >
> > > Can someone help please?
> >
> > Try:
> >
> >     Markup(
> >       'html',
> >       'fulltext',
> >       '/\\(:html:\\)(.*?)\\(:htmlend:\\)/esi',
> >       "Keep(str_replace(array('&gt;', '&lt;', '&amp;'),
> >                         array('<', '>', '&'), PSS('$1')))");
> 
> I started to add this to the cookbook, but I found two issues
> 
> 1) The last line should be
> 
>                        array('>', '<', '&'), PSS('$1')))");
> 
> 2) Is there any way to get this not to wrap the output in <p>paragraph</p> tags?

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')))");

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.  If I do this, the code would then be

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

Or perhaps just a KeepBlock() function that does the equivalent.

Pm




More information about the pmwiki-users mailing list