dokuwiki-plugin-mdpage
dokuwiki-plugin-mdpage copied to clipboard
DW-Hogfather: Call to undefined method Doku_Renderer_metadata::html()
After Upgrading DW to Version "Hogfather" some pages throw an error... other ones work like expected:
And attached txt-file is the content of a page, that don't render as expected: broken_md.txt
Content of the DW-Logs:
/public_html/lib/plugins/mdpage/src/DokuWiki/Plugin/Mdpage/MarkdownRendererTrait.php(156)
#0 /home/xxxxx/domains/wiki.xxxxx.com/public_html/lib/plugins/mdpage/vendor/cebe/markdown/Parser.php(203): DokuWiki\Plugin\Mdpage\Markdown\GitHubFlavored->renderInlineHtml()
#1 /home/xxxxx/domains/wiki.xxxxx.com/public_html/lib/plugins/mdpage/src/DokuWiki/Plugin/Mdpage/MarkdownRendererTrait.php(58): cebe\markdown\Parser->renderAbsy()
#2 /home/xxxxx/domains/wiki.xxxxx.com/public_html/lib/plugins/mdpage/vendor/cebe/markdown/Parser.php(203): DokuWiki\Plugin\Mdpage\Markdown\GitHubFlavored->renderParagraph()
#3 /home/xxxxx/domains/wiki.xxxxx.com/public_html/lib/plugins/mdpage/src/DokuWiki/Plugin/Mdpage/MarkdownRendererTrait.php(200): cebe\markdown\Parser->renderAbsy()
#4 /home/xxxxx/domains/wiki.xxxxx.com/public_html/lib/plugins/mdpage/vendor/cebe/markdown/Parser.php(203): DokuWiki\Plugin\Mdpage\Markdown\GitHubFlavored->renderQuote()
#5 /home/xxxxx/domains/wiki.xxxxx.com/public_html/lib/plugins/mdpage/vendor/cebe/markdown/Parser.php(61): cebe\markdown\Parser->renderAbsy()
#6 /home/xxxxx/domains/wiki.xxxxx.com/public_html/lib/plugins/mdpage/src/DokuWiki/Plugin/Mdpage/MarkdownRendererTrait.php(24): cebe\markdown\Parser->parse()
#7 /home/xxxxx/domains/wiki.xxxxx.com/public_html/lib/plugins/mdpage/src/DokuWiki/Plugin/Mdpage/Markdown.php(28): DokuWiki\Plugin\Mdpage\Markdown\GitHubFlavored->parseOnce()
#8 /home/xxxxx/domains/wiki.xxxxx.com/public_html/lib/plugins/mdpage/syntax.php(117): DokuWiki\Plugin\Mdpage\Markdown::parseWithRenderer()
#9 /home/xxxxx/domains/wiki.xxxxx.com/public_html/lib/plugins/mdpage/syntax.php(93): syntax_plugin_mdpage->renderWithRenderer()
#10 /home/xxxxx/domains/wiki.xxxxx.com/public_html/inc/parser/renderer.php(119): syntax_plugin_mdpage->render()
#11 /home/xxxxx/domains/wiki.xxxxx.com/public_html/inc/parserutils.php(540): Doku_Renderer->plugin()
#12 /home/xxxxx/domains/wiki.xxxxx.com/public_html/inc/parserutils.php(299): p_render_metadata()
#13 /home/xxxxx/domains/wiki.xxxxx.com/public_html/inc/common.php(266): p_get_metadata()
#14 /home/xxxxx/domains/wiki.xxxxx.com/public_html/doku.php(97): pageinfo()
#15 {main}
I've searched in the doku-wiki sources and found, that those functions are removed:
You also can see it if you compare the sources at github:
I've fixed it by commenting out the code in the both blocks, that handle html in md-plugin:
protected function renderHtml($block) {
/* $content = $block['content']."\n";
if ($this->isCommentOnlyXMLString($content)) {
return '';
}
global $conf;
if ($this->isGeshiFallbackVersion() && !$conf['htmlok']) {
$this->renderer->monospace_open();
$this->renderer->cdata($content);
$this->renderer->monospace_close();
} else {
$this->renderer->htmlblock($content);
}
*/
return $this->getRenderResult();
}
protected function renderInlineHtml($block) {
/* $content = $block[1];
if ($this->isCommentOnlyXMLString($content)) {
return '';
}
global $conf;
if ($this->isGeshiFallbackVersion() && !$conf['htmlok']) {
$this->renderer->monospace_open();
$this->renderer->cdata($content);
$this->renderer->monospace_close();
} else {
$this->renderer->html($content);
}
*/
return $this->getRenderResult();
}
@suther Thanks for details. However, since I retired from a DokuWiki user, this repository was abandoned, sorry. PRs are welcome.
I use the workaround for an Update to "Jack-Jackrum". It works well. On "Igor", the plugin was not a problem.
You can also install https://www.dokuwiki.org/plugin:htmlok – but I would recommend to switch to another markdown plugin e.g. https://www.dokuwiki.org/plugin:commonmark