]> sipb.mit.edu Git - ikiwiki.git/blobdiff - IkiWiki.pm
* Change yet again how unhandled and escaped preprocessor directives are
[ikiwiki.git] / IkiWiki.pm
index 0af4a4fe9303f292977294a8de5ec88d5ddf7d24..37c73cb9fa48ce3716b93576005b3b5c2a3b2fcf 100644 (file)
@@ -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
                )