[dokuwiki] Re: Plugin programming question - how to 're-parse' something?

  • From: Chris G <cl@xxxxxxxx>
  • To: dokuwiki@xxxxxxxxxxxxx
  • Date: Mon, 17 Oct 2011 10:27:35 +0100

On Mon, Oct 17, 2011 at 01:36:28AM +0100, Christopher Smith wrote:
> 
> On 16 Oct 2011, at 17:25, Guillaume Turri wrote:
> 
> > Hi,
> > 
> > 2011/10/14 Chris G <cl@xxxxxxxx>
> > Is it possible to re-parse some code from within a syntax plugin?
> > 
> > 
> > The hidden plugin[1] does it in two ways:
> > 1 - It parses the text in the first <hidden> tag. Here, it already has a 
> > text to parse. It's done like this:
> > >  $tab = array();
> > >  $parsedText = p_render('xhtml', p_get_instructions($rawText), $tab);
> > 
> > I'm afraid it's not the most effective way to do it (like in "we're 
> > launching a whole new parsing chain"); but it works.
> > 
> 
> The plugin base class has a method to do that, so usage in a syntax plugin 
> would be
> 
> $this->render('wiki text string');
> 
> http://phpxref.com/xref/dokuwiki/inc/plugin.php.source.html#l225
> 
OK, thanks, it just wraps up the p_get_instructions() but keeps the code
more modular and is also probably more future proof.

-- 
Chris Green
-- 
DokuWiki mailing list - more info at
http://www.dokuwiki.org/mailinglist

Other related posts: