From: Joey Hess Date: Sun, 1 Jan 2012 21:24:21 +0000 (-0400) Subject: workaround a bug in the discount perl binding X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=12f86df239e8a6c1d554d86b5c56e2b8713f6cd8;p=ikiwiki.git workaround a bug in the discount perl binding Empty input, or input consisting soley of whitespace caused an uninitialized value warning. --- diff --git a/IkiWiki/Plugin/mdwn.pm b/IkiWiki/Plugin/mdwn.pm index 0dc0cc336..b10d08517 100644 --- a/IkiWiki/Plugin/mdwn.pm +++ b/IkiWiki/Plugin/mdwn.pm @@ -53,7 +53,12 @@ sub htmlize (@) { if (! defined $markdown_sub) { eval q{use Text::Markdown::Discount}; if (! $@) { - $markdown_sub=\&Text::Markdown::Discount::markdown; + $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) {