[pmwiki-users] Markup question...

The Editor editor at fast.st
Mon Apr 2 09:04:09 CDT 2007


On 4/2/07, Patrick R. Michaud <pmichaud at pobox.com> wrote:
> On Mon, Apr 02, 2007 at 05:40:43AM -0400, The Editor wrote:
> > I have a simple markup I'm using to show Snippets code easily, and it
> > works fine except I can't seem to get the >>box<< to process.
> >
> > Markup('ZAPshow', '_begin', '/\(:show (.*?):\\)/',
> >       ">>box<<
> > Examples: [[$1]](:input form:)(:textarea name=test rows=10
> > cols=50:){(source $1#ID)}
> > >><<");
> >
> > Can anyone explain the secret to this?
>
> Sure.  In a markup rule, it would be "&gt;&gt;box&lt;&lt" instead of ">>box<<"
> (because angle brackets are converted to HTML entities at the start of
> markup processing).
>
> Also note that in order for >><< markups to work they have to be at the beginning of
> a line (this might not be true in the above if "(:show ...:) isn't at
> the beginning of a line).
>
> Lastly, it might not be a good idea to put this markup rule at '_begin',
> because it means that any [=...=] or [@...@] markups containing (:show:)
> won't be processed correctly.  I'd pick a slightly later "when" target.
>
> Pm



Ok, I made the change but it still shows the >><<'s.  Do you see any
other problem?

Markup('ZAPshow', '<{$var}', '/\(:show (.*?):\\)/',
	"&gt;&gt;box&lt;&lt
Examples: [[$1]](:input form:)(:textarea name=test rows=10
cols=50:){(source $1#ID)}(:input end:)
&gt;&gt;&lt;&lt");

Cheers,
Dan

PS. I'm using Hans' literal white space which is why there are not
trailing \\ for the line breaks.  Straight pasting of the text into
the page works fine.



More information about the pmwiki-users mailing list