X-Git-Url: http://git.vanrenterghem.biz/git.ikiwiki.info.git/blobdiff_plain/a2979b2b52eee47cc6d08274b5c6947aeaf9bfdc..d95f6fd87e1dfbec96ba810a67f4fc991c3f31e7:/IkiWiki/Plugin/mdwn.pm diff --git a/IkiWiki/Plugin/mdwn.pm b/IkiWiki/Plugin/mdwn.pm index 3de59ef3d..b10d08517 100644 --- a/IkiWiki/Plugin/mdwn.pm +++ b/IkiWiki/Plugin/mdwn.pm @@ -16,6 +16,7 @@ sub getsetup () { plugin => { safe => 1, rebuild => 1, # format plugin + section => "format", }, multimarkdown => { type => "boolean", @@ -49,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 (! $@) {