[Pmwiki-users] Pre-formatted text hook?
Fri Oct 10 03:42:35 CDT 2003
> > I was wondering if it would be possible to add a hook for extending the
> > preformatted text syntax [= ... =], something along the lines of what I
> > did for the "beautifier" plugin? There, I look at the text immediately
> > following the opening brace, so
> > [=cpp ... =]
> > means a block of preformatted C++ code. Currently, it is necessary to
> > modify the PrintText() function in pmwiki.php. Is there any possibility
> > of creating an official mechanism for this sort of thing? What is needed
> > is a way to register a handler for a particular type of preformatted
> > text, which would be called with the enclosed text. The handler would
> > return a new block of text that would be placed into the "$kpv" array.
> > Feel free to recommend a new markup, I just did what was easiest.
How about adding a ':' to make it a bit more obvious, e.g. [=cpp: ...=]
especially, since the markup [=...=] shows up all over the place when I
write more complicated pages.
It's probably a good idea to demand the space as well, i.e. this does not
give Cpp: [=cpp:...=] whereas this does [=cpp: ...=] (since [=...=]
doesn't require a space).
Ph.D. Christian Ridderstr?m, +46-8-768 39 44 http://www.md.kth.se/~chr
More information about the pmwiki-users