X-Git-Url: http://git.vanrenterghem.biz/git.ikiwiki.info.git/blobdiff_plain/eabafab8e4aa15fd47bd8bf4a20face7d12e5e30..be0b4f603f918444b906e42825908ddac78b7073:/IkiWiki/Plugin/mdwn.pm?ds=inline diff --git a/IkiWiki/Plugin/mdwn.pm b/IkiWiki/Plugin/mdwn.pm index 625f77f21..254ab51d0 100644 --- a/IkiWiki/Plugin/mdwn.pm +++ b/IkiWiki/Plugin/mdwn.pm @@ -4,7 +4,7 @@ package IkiWiki::Plugin::mdwn; use warnings; use strict; -use IkiWiki; +use IkiWiki 2.00; sub import { #{{{ hook(type => "htmlize", id => "mdwn", call => \&htmlize); @@ -34,7 +34,7 @@ sub htmlize (@) { #{{{ } else { do "/usr/bin/markdown" || - error("failed to load Markdown.pm perl module ($@) or /usr/bin/markdown ($!)"); + error(sprintf(gettext("failed to load Markdown.pm perl module (%s) or /usr/bin/markdown (%s)"), $@, $!)); $markdown_sub=\&Markdown::Markdown; } } @@ -43,9 +43,11 @@ sub htmlize (@) { #{{{ # Workaround for perl bug (#376329) $content=Encode::encode_utf8($content); - $content=Encode::encode_utf8($content); - $content=&$markdown_sub($content); - $content=Encode::decode_utf8($content); + eval {$content=&$markdown_sub($content)}; + if ($@) { + eval {$content=&$markdown_sub($content)}; + print STDERR $@ if $@; + } $content=Encode::decode_utf8($content); return $content;