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:

> I already wrote such a patch a few days ago and applied it to git. Might
> be a good idea to check out current git master before spending time on
> patches in the future. Thanks for the work anyway.. --[[Joey]]

[[tag done]]

    --- 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]]

[[tag patch]]
