summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJoey Hess <joey@kitenet.net>2008-03-09 09:18:21 -0400
committerJoey Hess <joey@kitenet.net>2008-03-09 09:18:21 -0400
commit265161e7051f518a4ab4c636bfed55f5a411b2f6 (patch)
treefdabe7c6014450786ff5f8cefea8abdbf53aca74
parentc0c9dd82d8d73b4f76368b640df3af4f08ed0d9b (diff)
web commit by HenrikBrixAndersen: Add patch for working with new Text::Markdown module from CPAN
-rw-r--r--doc/todo/Add_support_for_latest_Text::Markdown_as_found_on_CPAN.mdwn38
1 files changed, 38 insertions, 0 deletions
diff --git a/doc/todo/Add_support_for_latest_Text::Markdown_as_found_on_CPAN.mdwn b/doc/todo/Add_support_for_latest_Text::Markdown_as_found_on_CPAN.mdwn
new file mode 100644
index 000000000..83b3f16ba
--- /dev/null
+++ b/doc/todo/Add_support_for_latest_Text::Markdown_as_found_on_CPAN.mdwn
@@ -0,0 +1,38 @@
+Recent versions of Text::Markdown as found on CPAN (e.g. 1.0.16) no longer contains a Text::Markdown::Markdown() routine, but instead contains a Text::Markdown::markdown() routine (notice the difference in capitalization).
+
+It seems that the Text::Markdown module as found on CPAN is now identical to Text::MultiMarkdown - hence the subtle change.
+
+This patch allows IkiWiki to work with either of the two:
+
+ --- IkiWiki/Plugin/mdwn.pm.orig 2008-03-08 11:33:50.000000000 +0100
+ +++ IkiWiki/Plugin/mdwn.pm 2008-03-08 13:37:21.000000000 +0100
+ @@ -28,14 +28,20 @@ sub htmlize (@) { #{{{
+ $markdown_sub=\&Markdown::Markdown;
+ }
+ else {
+ - eval q{use Text::Markdown};
+ + eval q{use Text::Markdown 'Markdown'};
+ if (! $@) {
+ $markdown_sub=\&Text::Markdown::Markdown;
+ }
+ else {
+ - do "/usr/bin/markdown" ||
+ - error(sprintf(gettext("failed to load Markdown.pm perl module (%s) or /usr/bin/markdown (%s)"), $@, $!));
+ - $markdown_sub=\&Markdown::Markdown;
+ + eval q{use Text::Markdown 'markdown'};
+ + if (! $@) {
+ + $markdown_sub=\&Text::Markdown::markdown;
+ + }
+ + else {
+ + do "/usr/bin/markdown" ||
+ + error(sprintf(gettext("failed to load Markdown.pm perl module (%s) or /usr/bin/markdown (%s)"), $@, $!));
+ + $markdown_sub=\&Markdown::Markdown;
+ + }
+ }
+ }
+ require Encode;
+
+The above patch, which is against ikiwiki-2.40, should fix [[bugs/markdown_module_location]].
+
+-- [[HenrikBrixAndersen]]
+