improve fix to DTRT for a param of "0"
authorJoey Hess <joey@kodama.kitenet.net>
Mon, 4 Aug 2008 18:58:21 +0000 (14:58 -0400)
committerJoey Hess <joey@kodama.kitenet.net>
Mon, 4 Aug 2008 18:58:21 +0000 (14:58 -0400)
IkiWiki.pm

index 051c11b43c2633a66bee8aa9a4f11b1c7ed24fc9..207bf3079a2083ccf047837af6601168d938ada8 100644 (file)
@@ -1043,7 +1043,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}) {
@@ -1176,8 +1178,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;
 } #}}}