Lexer->addSpecialPattern('{{simplebox>.*?}}', $mode, 'plugin_simplebox');
$this->Lexer->addSpecialPattern('{{simplebox-linebreak}}', $mode, 'plugin_simplebox');
}
public function handle($match, $state, $pos, Doku_Handler $handler) {
if ($match === '{{simplebox-linebreak}}') {
return 'linebreak';
} else {
preg_match('/{{simplebox>(.*?)\|size=(\d+)\|content=(.*?)}}/', $match, $matches);
return array(
'color' => $matches[1],
'size' => (int) $matches[2],
'content' => $matches[3]
);
}
}
public function render($mode, Doku_Renderer $renderer, $data) {
if ($mode !== 'xhtml') return false;
if ($data === 'linebreak') {
$renderer->doc .= '
';
} else {
$color = $data['color'];
$size = $data['size'];
$content = $data['content'];
$renderer->doc .= '