[dokuwiki] rendering wiki syntax correctly in plugin

  • From: Otto Vainio <otto@xxxxxxxxxxxx>
  • To: dokuwiki@xxxxxxxxxxxxx
  • Date: Tue, 22 Mar 2011 19:44:12 +0200

Hi

i have several plugins which wrap part of the page between start and end tags. The text between the tags is wiki syntax text which should be redered normally.

Like in my sortable plugin.

The syntax is
<sortable>
^head1^head2^
|r1c1|r1c2|
|r2c1|r2c2|
</sortable>

in render I have basically this

function render($mode, &$renderer, $data) {
  list($state,$match) = $data;
  if ($mode == 'xhtml'){
    switch ($state) {
      case DOKU_LEXER_ENTER :
        $renderer->doc .= "<div class=\"sortable$match\">";
        break;
      case DOKU_LEXER_UNMATCHED :
     $renderer->doc.=p_render('xhtml',p_get_instructions($match),$info);
        break;
      case DOKU_LEXER_EXIT :
        $renderer->doc .=  "</div>";
        break;
    }
    return true;
...
}

Now this looks quite ok, but some features, like edittable, section editing and footnotes are not working correctly. In edittable edit button the hidden value for "range" starts from the beginning of the page. Not where my table starts..

What is the correct way to do this? I have searched, but cannot find anything relevant.

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

Other related posts: