* @author Esther Brunner */ /** * All DokuWiki plugins to extend the parser/rendering mechanism * need to inherit from this class */ class syntax_plugin_creole_linebreak extends DokuWiki_Syntax_Plugin { function getType() { return 'substition'; } function getSort() { return 100; } function connectTo($mode) { $this->Lexer->addSpecialPattern( '(?)', $mode, 'plugin_creole_linebreak' ); } function handle($match, $state, $pos, Doku_Handler $handler) { if ($match == "\n") return true; return false; } function render($mode, Doku_Renderer $renderer, $data) { if($mode == 'xhtml') { if ($data) { if ( $this->getConf('linebreak') == 'Linebreak' ) { $renderer->doc .= "
"; } else { $renderer->doc .= " "; } } return true; } return false; } } // vim:ts=4:sw=4:et:enc=utf-8: