X-Git-Url: http://git.vanrenterghem.biz/git.ikiwiki.info.git/blobdiff_plain/a63929f6cc7778ffc4ba57d784cdf2206ec650c7..fa99332893ed8ede41857806e2b92ed02ea1c9d8:/IkiWiki/Plugin/mdwn.pm diff --git a/IkiWiki/Plugin/mdwn.pm b/IkiWiki/Plugin/mdwn.pm index 4ddf097ba..b10d08517 100644 --- a/IkiWiki/Plugin/mdwn.pm +++ b/IkiWiki/Plugin/mdwn.pm @@ -16,7 +16,7 @@ sub getsetup () { plugin => { safe => 1, rebuild => 1, # format plugin - section => "core", + section => "format", }, multimarkdown => { type => "boolean", @@ -50,6 +50,17 @@ sub htmlize (@) { } } } + if (! defined $markdown_sub) { + eval q{use Text::Markdown::Discount}; + if (! $@) { + $markdown_sub=sub { + # Workaround for discount binding bug + # https://rt.cpan.org/Ticket/Display.html?id=73657 + return "" if $_[0]=~/^\s*$/; + Text::Markdown::Discount::markdown(@_); + } + } + } if (! defined $markdown_sub) { eval q{use Text::Markdown}; if (! $@) {