foo
[git.ikiwiki.info.git] / IkiWiki / Plugin / mdwn.pm
index 2274fea72489b3256cd3d05ee9b0ba7f0dd82d42..0fc077f5ec1cc1a30eaffba1ce8d323cccf160cf 100644 (file)
@@ -7,7 +7,7 @@ use strict;
 use IkiWiki;
 
 sub import { #{{{
-       IkiWiki::hook(type => "htmlize", id => "mdwn", call => \&htmlize);
+       hook(type => "htmlize", id => "mdwn", call => \&htmlize);
 } # }}}
 
 my $markdown_loaded=0;
@@ -25,8 +25,11 @@ sub htmlize (@) { #{{{
 
                eval q{use Markdown};
                if ($@) {
-                       do "/usr/bin/markdown" ||
-                               IkiWiki::error("failed to load Markdown.pm perl module ($@) or /usr/bin/markdown ($!)");
+                       eval q{use Text::Markdown};
+                       if ($@) {
+                               do "/usr/bin/markdown" ||
+                                       error("failed to load Markdown.pm perl module ($@) or /usr/bin/markdown ($!)");
+                       }
                }
                $markdown_loaded=1;
                require Encode;