X-Git-Url: https://sipb.mit.edu/gitweb.cgi/ikiwiki.git/blobdiff_plain/90bce7d13923769e0bee64d4a17d67c1df4c1aa9..4948a3188967bdaa7c2646e78b43ccf70603e8c1:/IkiWiki.pm diff --git a/IkiWiki.pm b/IkiWiki.pm index a8703450c..46060c1b2 100644 --- a/IkiWiki.pm +++ b/IkiWiki.pm @@ -32,7 +32,7 @@ memoize("file_pruned"); sub defaultconfig () { #{{{ return - wiki_file_prune_regexps => [qr/^\.\.$/, qr/^\./, qr/\/\./, + wiki_file_prune_regexps => [qr/(^|\/)\.\.(\/|$)/, qr/^\./, qr/\/\./, qr/\.x?html?$/, qr/\.ikiwiki-new$/, qr/(^|\/).svn\//, qr/.arch-ids\//, qr/{arch}\//, qr/(^|\/)_MTN\//, @@ -613,6 +613,8 @@ sub htmlize ($$$) { #{{{ my $page=shift; my $type=shift; my $content=shift; + + my $oneline = $content !~ /\n/; if (exists $hooks{htmlize}{$type}) { $content=$hooks{htmlize}{$type}{call}->( @@ -630,6 +632,14 @@ sub htmlize ($$$) { #{{{ content => $content, ); }); + + if ($oneline) { + # hack to get rid of enclosing junk added by markdown + # and other htmlizers + $content=~s/^

//i; + $content=~s/<\/p>$//i; + chomp $content; + } return $content; } #}}} @@ -723,12 +733,25 @@ sub preprocess ($$$;$$) { #{{{ $command, $page, $preprocessing{$page}). "]]"; } - my $ret=$hooks{preprocess}{$command}{call}->( - @params, - page => $page, - destpage => $destpage, - preview => $preprocess_preview, - ); + my $ret; + if (! $scan) { + $ret=$hooks{preprocess}{$command}{call}->( + @params, + page => $page, + destpage => $destpage, + preview => $preprocess_preview, + ); + } + else { + # use void context during scan pass + $hooks{preprocess}{$command}{call}->( + @params, + page => $page, + destpage => $destpage, + preview => $preprocess_preview, + ); + $ret=""; + } $preprocessing{$page}--; return $ret; }