+
+ if (exists $config{multimarkdown} && $config{multimarkdown}) {
+ eval q{use Text::MultiMarkdown};
+ if ($@) {
+ error(gettext("multimarkdown is enabled, but Text::MultiMarkdown is not installed"));
+ }
+ $markdown_sub=sub {
+ Text::MultiMarkdown::markdown(shift, {use_metadata => 0});
+ }
+ }
+ else {
+ eval q{use Text::Markdown};
+ if (! $@) {
+ if (Text::Markdown->can('markdown')) {
+ $markdown_sub=\&Text::Markdown::markdown;
+ }
+ else {
+ $markdown_sub=\&Text::Markdown::Markdown;
+ }
+ }
+ else {
+ eval q{use Markdown};
+ if (! $@) {
+ $markdown_sub=\&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;
+ }
+ }
+ }
+