Lexer->addEntryPattern('(?=.*?)',$mode,'plugin_randompage2'); } public function postConnect() { $this->Lexer->addExitPattern('','plugin_randompage2'); } /** * Handle the match */ public function handle($match, $state, $pos, Doku_Handler $handler){ switch ($state) { case DOKU_LEXER_ENTER : return array($state, ''); case DOKU_LEXER_UNMATCHED : return array($state, $match); case DOKU_LEXER_EXIT : return array($state, ''); } return array(); } /** * Create output */ public function render($mode, Doku_Renderer $renderer, $data) { global $ID; // $data is what the function handle() return'ed. if($mode == 'xhtml'){ /** @var Doku_Renderer_xhtml $renderer */ list($state, $match) = $data; switch ($state) { case DOKU_LEXER_ENTER : $renderer->doc .= ''; break; case DOKU_LEXER_UNMATCHED : $renderer->doc .= $renderer->_xmlEntities($match); break; case DOKU_LEXER_EXIT : $renderer->doc .= ''; break; } return true; } return false; } }