X-Git-Url: https://sipb.mit.edu/gitweb.cgi/ikiwiki.git/blobdiff_plain/09b0a3b73f7c9ca873c3e20a64b124c0749b3d3b..b4dafe467be5f6c885204887aeae2f4d513b3640:/IkiWiki.pm diff --git a/IkiWiki.pm b/IkiWiki.pm index 0af4a4fe9..37c73cb9f 100644 --- a/IkiWiki.pm +++ b/IkiWiki.pm @@ -160,11 +160,20 @@ sub loadplugin ($) { #{{{ return if grep { $_ eq $plugin} @{$config{disable_plugins}}; + foreach my $dir ($config{libdir}, "$installdir/lib/ikiwiki") { + if (defined $dir && -x "$dir/plugins/$plugin") { + require IkiWiki::Plugin::external; + import IkiWiki::Plugin::external "$dir/plugins/$plugin"; + return 1; + } + } + my $mod="IkiWiki::Plugin::".possibly_foolish_untaint($plugin); eval qq{use $mod}; if ($@) { error("Failed to load plugin $mod: $@"); } + return 1; } #}}} sub error ($;$) { #{{{ @@ -617,7 +626,7 @@ sub preprocess ($$$;$$) { #{{{ my $command=shift; my $params=shift; if (length $escape) { - return "\\[[$command $params]]"; + return "[[$command $params]]"; } elsif (exists $hooks{preprocess}{$command}) { return "" if $scan && ! $hooks{preprocess}{$command}{scan}; @@ -678,7 +687,7 @@ sub preprocess ($$$;$$) { #{{{ return $ret; } else { - return "\\[[$command $params]]"; + return "[[$command $params]]"; } }; @@ -1041,7 +1050,7 @@ sub pagespec_translate ($) { #{{{ | \) # ) | - \w+\([^\)]+\) # command(params) + \w+\([^\)]*\) # command(params) | [^\s()]+ # any other text )