X-Git-Url: https://sipb.mit.edu/gitweb.cgi/ikiwiki.git/blobdiff_plain/2b9ce0129bc61177e976caf432af9b4406ab2f3f..07ef42afee4c10722610c8ca2b3998d88af32abc:/IkiWiki/Plugin/mdwn.pm diff --git a/IkiWiki/Plugin/mdwn.pm b/IkiWiki/Plugin/mdwn.pm index 1520b3eec..2ffe7bc3e 100644 --- a/IkiWiki/Plugin/mdwn.pm +++ b/IkiWiki/Plugin/mdwn.pm @@ -30,7 +30,12 @@ sub htmlize (@) { #{{{ else { eval q{use Text::Markdown}; if (! $@) { - $markdown_sub=\&Text::Markdown::Markdown; + if (Text::Markdown->can('markdown')) { + $markdown_sub=\&Text::Markdown::markdown; + } + else { + $markdown_sub=\&Text::Markdown::Markdown; + } } else { do "/usr/bin/markdown" || @@ -41,8 +46,6 @@ sub htmlize (@) { #{{{ require Encode; } - my $oneline = $content !~ /\n/; - # Workaround for perl bug (#376329) $content=Encode::encode_utf8($content); eval {$content=&$markdown_sub($content)}; @@ -52,13 +55,6 @@ sub htmlize (@) { #{{{ } $content=Encode::decode_utf8($content); - if ($oneline) { - # hack to get rid of enclosing junk added by markdown - $content=~s!^

!!; - $content=~s!

$!!; - chomp $content; - } - return $content; } # }}}