aboutsummaryrefslogtreecommitdiff
path: root/IkiWiki/Plugin/mdwn.pm
diff options
context:
space:
mode:
authorJoey Hess <joey@kodama.kitenet.net>2008-03-04 20:29:52 -0500
committerJoey Hess <joey@kodama.kitenet.net>2008-03-04 20:29:52 -0500
commiteec482aa65ba5d6274cba803f527af974de35007 (patch)
treecdfdf53d57bd3c7583a804da7712282e254d613c /IkiWiki/Plugin/mdwn.pm
parent0217eebf4901860dd04cbf22ee0d81b69b1396a0 (diff)
downloadikiwiki-eec482aa65ba5d6274cba803f527af974de35007.tar
ikiwiki-eec482aa65ba5d6274cba803f527af974de35007.tar.gz
test for Text::Markdown::[Mm]arkdown and use the available one
Markdown is such a splintered mess.. The current debian package provides only Text::Markdown::Markdown, while all versions of Text::Markdown support Text::Markdown::markdown, and old versions also support the capitalised version, while new ones don't. It's getting to the point where `grep /markdown/i %symbol_table` is the only sane way to figure out what function to call..
Diffstat (limited to 'IkiWiki/Plugin/mdwn.pm')
-rw-r--r--IkiWiki/Plugin/mdwn.pm7
1 files changed, 6 insertions, 1 deletions
diff --git a/IkiWiki/Plugin/mdwn.pm b/IkiWiki/Plugin/mdwn.pm
index cabf44aa5..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" ||