X-Git-Url: http://git.vanrenterghem.biz/git.ikiwiki.info.git/blobdiff_plain/18f35269c26dd23e1c91c5e930ed5d62526b558f..bed518378afafa626d98260a7754bfae7cdb8327:/IkiWiki/Plugin/mdwn.pm?ds=inline diff --git a/IkiWiki/Plugin/mdwn.pm b/IkiWiki/Plugin/mdwn.pm index 3c3fc9579..daf9d592e 100644 --- a/IkiWiki/Plugin/mdwn.pm +++ b/IkiWiki/Plugin/mdwn.pm @@ -9,6 +9,7 @@ use IkiWiki 3.00; sub import { hook(type => "getsetup", id => "mdwn", call => \&getsetup); hook(type => "htmlize", id => "mdwn", call => \&htmlize, longname => "Markdown"); + hook(type => "htmlize", id => "md", call => \&htmlize, longname => "Markdown (popular file extension)", nocreate => 1); } sub getsetup () { @@ -58,7 +59,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 +93,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; } }