*/ if(!defined('DOKU_INC')) die(); require_once(DOKU_PLUGIN.'/syntax.php'); class syntax_plugin_marked extends DokuWiki_Syntax_Plugin { public function getType() { return 'substition'; } public function getPType() { return 'block'; } public function getSort() { return 155; } public function connectTo($mode) { $this->Lexer->addSpecialPattern('\{\{marked\}\}', $mode, 'plugin_marked'); } public function handle($match, $state, $pos, Doku_Handler $handler) { return array(); } public function render($mode, Doku_Renderer $renderer, $data) { if($mode != 'xhtml') return false; // Získat obsah celé stránky global $ID; $pageContent = rawWiki($ID); // Najít všechny označené texty pomocí regulárního výrazu preg_match_all('/(.*?)<\/mark>/s', $pageContent, $matches); if(!empty($matches[1])) { $renderer->doc .= '
'; $renderer->doc .= ''; $renderer->doc .= '
'; } return true; } }