]> sipb.mit.edu Git - ikiwiki.git/blobdiff - IkiWiki/Plugin/mdwn.pm
* aggregate: Fork a child process to handle the aggregation. This simplifies
[ikiwiki.git] / IkiWiki / Plugin / mdwn.pm
index c087f2b41309f892e52476305bf31ccc48fb7840..254ab51d03b078afbbeed1727fdb56b18a6c1a1c 100644 (file)
@@ -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);
@@ -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;