nested_brackets_re = str_repeat('(?>[^\[\]]+|\[', 6). str_repeat('\])*', 6); $this->Lexer->addSpecialPattern( '\!\['.$this->nested_brackets_re.'\]\([ \t]*?[ \t]*(?:[\'"].*?[\'"])?\)', $mode, 'plugin_markdowku_imagesinline'); } function handle($match, $state, $pos, Doku_Handler $handler) { if ($state == DOKU_LEXER_SPECIAL) { $text = preg_match( '/^\!\[('.$this->nested_brackets_re.')\]\([ \t]*?[ \t]*(?:[\'"](.*?)[\'"])?[ \t]*?\)$/', $match, $matches); $target = $matches[2] == '' ? $matches[3] : $matches[2]; $title = $matches[1]; $handler->media($target.'|'.$title, $state, $pos); } return true; } function render($mode, Doku_Renderer $renderer, $data) { return true; } } //Setup VIM: ex: et ts=4 enc=utf-8 :