Lexer->addSpecialPattern('~~cssp_openDIV~~',$mode,'plugin_cssperpage'); $this->Lexer->addSpecialPattern('~~cssp_closeDIV~~',$mode,'plugin_cssperpage'); $this->Lexer->addSpecialPattern('~~cssp_\w+_openDIV~~',$mode,'plugin_cssperpage'); } function handle($match, $state, $pos, Doku_Handler $handler){ if(preg_match("/~~cssp_(.*?)_openDIV/",$match,$matches)) { $class=$matches[1]; $match = $class . ';' . 'openDIV'; } else $match = substr($match,7,-2); switch ($state) { case DOKU_LEXER_SPECIAL : return array($state, $match); } return array($state,""); } function render($mode, Doku_Renderer $renderer, $data) { if($mode == 'xhtml'){ list($state,$match) = $data; switch ($state) { case DOKU_LEXER_SPECIAL : list($class,$rest) = explode(';',$match); if($rest) { $match = 'openDIV'; } else { $class ='opencss'; } if($match == 'openDIV') { $renderer->doc .= "\n
\n"; } elseif($match == 'closeDIV') { $renderer->doc .= "\n
\n"; } return true; } } return false; } } ?>