X-Git-Url: http://git.vanrenterghem.biz/git.ikiwiki.info.git/blobdiff_plain/12fd902fb1228feb4e23a1f850f215122a4c7e3f..1ef40ff68370aba85e9816221675a8edd7a308f5:/IkiWiki/Plugin/mdwn.pm?ds=sidebyside

diff --git a/IkiWiki/Plugin/mdwn.pm b/IkiWiki/Plugin/mdwn.pm
index 3c3fc9579..014e78eea 100644
--- a/IkiWiki/Plugin/mdwn.pm
+++ b/IkiWiki/Plugin/mdwn.pm
@@ -58,7 +58,7 @@ sub htmlize (@) {
 			}
 		}
 		if (! defined $markdown_sub &&
-		    exists $config{nodiscount} && ! $config{nodiscount}) {
+		    (! exists $config{nodiscount} || ! $config{nodiscount})) {
 			eval q{use Text::Markdown::Discount};
 			if (! $@) {
 				$markdown_sub=sub {
@@ -92,8 +92,9 @@ sub htmlize (@) {
 					$markdown_sub=\&Markdown::Markdown;
 				}
 				else {
+					my $error = $@;
 					do "/usr/bin/markdown" ||
-						error(sprintf(gettext("failed to load Markdown.pm perl module (%s) or /usr/bin/markdown (%s)"), $@, $!));
+						error(sprintf(gettext("failed to load Markdown.pm perl module (%s) or /usr/bin/markdown (%s)"), $error, $!));
 					$markdown_sub=\&Markdown::Markdown;
 				}
 			}