2 # Markdown markup language
3 package IkiWiki::Plugin::mdwn;
10 IkiWiki::hook(type => "htmlize", id => "mdwn", call => \&htmlize);
13 my $markdown_loaded=0;
14 sub htmlize (@) { #{{{
16 my $content = $params{content};
18 if (! $markdown_loaded) {
19 # Note: This hack to make markdown run as a proper perl
20 # module. A proper perl module is available in Debian
21 # for markdown, but not upstream yet.
23 $blosxom::version="is a proper perl module too much to ask?";
28 do "/usr/bin/markdown" ||
29 IkiWiki::error("failed to load Markdown.pm perl module ($@) or /usr/bin/markdown ($!)");
35 # Workaround for perl bug (#376329)
36 $content=Encode::encode_utf8($content);
37 $content=Encode::encode_utf8($content);
38 $content=Markdown::Markdown($content);
39 $content=Encode::decode_utf8($content);
40 $content=Encode::decode_utf8($content);