diff options
author | Joey Hess <joey@kodama.kitenet.net> | 2008-08-04 14:58:21 -0400 |
---|---|---|
committer | Joey Hess <joey@kodama.kitenet.net> | 2008-08-04 14:58:21 -0400 |
commit | 6f2d1536b8ce0bd746c87c00466170435ddb3923 (patch) | |
tree | 75fb7de8c22c29448f674b0e19eb346620c6fbb4 | |
parent | 86674c95840abe80c09fe5f4cd19988629806233 (diff) |
improve fix to DTRT for a param of "0"
-rw-r--r-- | IkiWiki.pm | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/IkiWiki.pm b/IkiWiki.pm index 051c11b43..207bf3079 100644 --- a/IkiWiki.pm +++ b/IkiWiki.pm @@ -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; } #}}} |