dokuwikiVersion == null) { $this->dokuwikiVersion = getVersionData()['date']; } return $this->dokuwikiVersion; } public function getType() { return 'protected'; } public function getPType() { return 'block'; } public function getSort() { return 69; } public function getPluginName() { return $this->getInfo()['base']; } public function getPluginMode() { return 'plugin_' . $this->getPluginName(); } public function connectTo($mode) { if ($this->getConf('markdown_default')) { $this->Lexer->addEntryPattern('\\A(?!.*).', $mode, $this->getPluginMode()); $this->Lexer->addEntryPattern('', $mode, $this->getPluginMode()); $this->Lexer->addEntryPattern('', $mode, $this->getPluginMode()); } else { $this->Lexer->addEntryPattern('(?=.*)', $mode, $this->getPluginMode()); } } public function postConnect() { $pluginBaseMode = 'plugin_' . $this->getPluginName(); if ($this->getConf('markdown_default')) { $this->Lexer->addExitPattern('\\z', $this->getPluginMode()); $this->Lexer->addExitPattern('|', $match)) { $new_pos = $new_pos - strlen(''); } else if (preg_match('|^|', $match)) { $new_pos = $new_pos - strlen(''); } } else { $new_pos = $new_pos - strlen(''); } return [ 'render' => true, 'match' => $match, 'pos' => $new_pos, ]; default: return [ 'render' => false, ]; } } public function render($format, Doku_Renderer $renderer, $data) { if (!$data['render']) { return true; } $match = $data['match']; return $this->renderWithRenderer($renderer, $match, $data); } protected function renderWithRenderer(Doku_Renderer $renderer, $match, $data) { switch ($this->getConf('flavor')) { case 'github-flavored': $flavor = Markdown::GITHUB_FLAVORED; break; case 'markdown-extra': $flavor = Markdown::MARKDOWN_EXTRA; break; case 'traditional': $flavor = Markdown::TRADITIONAL; break; default: $flavor = Markdown::GITHUB_FLAVORED; break; } $context = [ 'dokuwiki_version' => $this->dokuwikiVersion, 'flavor' => $flavor, ]; $result = Markdown::parseWithRenderer($renderer, $match, $data, $context); /* echo '
';
        var_dump(htmlspecialchars($match));
        var_dump(htmlspecialchars($result));
        echo '
'; */ return true; } protected function _debug($message, $err, $line, $file = __FILE__) { if ($this->getConf('debug')) { msg($message, $err, $line, $file); } } }