]> sipb.mit.edu Git - ikiwiki.git/blob - doc/todo/Add_support_for_latest_Text::Markdown_as_found_on_CPAN.mdwn
(no commit message)
[ikiwiki.git] / doc / todo / Add_support_for_latest_Text::Markdown_as_found_on_CPAN.mdwn
1 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).
2
3 It seems that the Text::Markdown module as found on CPAN is now identical to Text::MultiMarkdown - hence the subtle change.
4
5 This patch allows IkiWiki to work with either of the two:
6
7 > I already wrote such a patch a few days ago and applied it to git. Might
8 > be a good idea to check out current git master before spending time on
9 > patches in the future. Thanks for the work anyway.. --[[Joey]]
10
11 [[tag done]]
12
13     --- IkiWiki/Plugin/mdwn.pm.orig     2008-03-08 11:33:50.000000000 +0100
14     +++ IkiWiki/Plugin/mdwn.pm  2008-03-08 13:37:21.000000000 +0100
15     @@ -28,14 +28,20 @@ sub htmlize (@) { #{{{
16                         $markdown_sub=\&Markdown::Markdown;
17                 }
18                 else {
19     -                   eval q{use Text::Markdown};
20     +                   eval q{use Text::Markdown 'Markdown'};
21                         if (! $@) {
22                                 $markdown_sub=\&Text::Markdown::Markdown;
23                         }
24                         else {
25     -                           do "/usr/bin/markdown" ||
26     -                                   error(sprintf(gettext("failed to load Markdown.pm perl module (%s) or /usr/bin/markdown (%s)"), $@, $!));
27     -                           $markdown_sub=\&Markdown::Markdown;
28     +                           eval q{use Text::Markdown 'markdown'};
29     +                           if (! $@) {
30     +                                   $markdown_sub=\&Text::Markdown::markdown;
31     +                           }
32     +                           else {
33     +                                   do "/usr/bin/markdown" ||
34     +                                           error(sprintf(gettext("failed to load Markdown.pm perl module (%s) or /usr/bin/markdown (%s)"), $@, $!));
35     +                                   $markdown_sub=\&Markdown::Markdown;
36     +                           }
37                         }
38                 }
39                 require Encode;
40
41 The above patch, which is against ikiwiki-2.40, should fix [[bugs/markdown_module_location]].
42
43 -- [[HenrikBrixAndersen]]
44
45 [[tag patch]]