*/ class syntax_plugin_qna_header extends DokuWiki_Syntax_Plugin { private $mode; /** * Constructor */ public function __construct() { $this->mode = substr(get_class($this), 7); } /** * What kind of syntax are we? */ public function getType() { return 'baseonly'; } public function getPType() { return 'block'; } /** * Where to sort in? */ public function getSort() { return 50; } /** * */ public function connectTo($mode) { $this->Lexer->addSpecialPattern('[ \t]*=\?={1,4}[^=\n][^\n]+={3,}[ \t]*(?=\n)', $mode, $this->mode); } /** * */ function handle($match, $state, $pos, Doku_Handler $handler) { if ($state == DOKU_LEXER_SPECIAL) { $match = preg_replace('/^(\s*=)\?/', '$1=', $match); $handler->header($match, $state, $pos); $data = array('dummy'); } else { $data = false; } return $data; } /** * */ function render($mode, Doku_Renderer $renderer, $data) { if ($mode == 'xhtml') { switch ($data[0]) { case 'open': $renderer->doc .= DOKU_LF . '