diff options
author | Joey Hess <joey@kitenet.net> | 2012-01-01 17:24:21 -0400 |
---|---|---|
committer | Joey Hess <joey@kitenet.net> | 2012-01-01 17:28:31 -0400 |
commit | 12f86df239e8a6c1d554d86b5c56e2b8713f6cd8 (patch) | |
tree | 70dd7a347837a93d327ebe503af8ad4f3817f650 | |
parent | 37f7f125f910b66ff7f43136ba08d3c849b139e8 (diff) | |
download | ikiwiki-12f86df239e8a6c1d554d86b5c56e2b8713f6cd8.tar ikiwiki-12f86df239e8a6c1d554d86b5c56e2b8713f6cd8.tar.gz |
workaround a bug in the discount perl binding
Empty input, or input consisting soley of whitespace
caused an uninitialized value warning.
-rw-r--r-- | IkiWiki/Plugin/mdwn.pm | 7 |
1 files changed, 6 insertions, 1 deletions
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) { |