]> git.vanrenterghem.biz Git - git.ikiwiki.info.git/blobdiff - IkiWiki.pm
improve fix to DTRT for a param of "0"
[git.ikiwiki.info.git] / IkiWiki.pm
index e0793b5faa4c362a112cb86e9d6abd06544240b3..4de8f71d6ce60743de22d0ea9efaeeb875de5999 100644 (file)
@@ -718,7 +718,9 @@ sub preprocess ($$$;$$) { #{{{
                my $prefix=shift;
                my $command=shift;
                my $params=shift;
-               if (length $escape) {
+               $params="" if ! defined $params;
+
+               f (length $escape) {
                        return "[[$prefix$command $params]]";
                }
                elsif (exists $hooks{preprocess}{$command}) {
@@ -844,8 +846,7 @@ sub preprocess ($$$;$$) { #{{{
                }sx;
        }
 
-       # $4 can be undef if the directive was [[!foo]]
-       $content =~ s{$regex}{$handle->($1, $2, $3, ($4 or ""))}eg;
+       $content =~ s{$regex}{$handle->($1, $2, $3, $4)}eg;
        return $content;
 } #}}}