From 12f86df239e8a6c1d554d86b5c56e2b8713f6cd8 Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Sun, 1 Jan 2012 17:24:21 -0400 Subject: [PATCH] workaround a bug in the discount perl binding Empty input, or input consisting soley of whitespace caused an uninitialized value warning. --- IkiWiki/Plugin/mdwn.pm | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) 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) { -- 2.26.2