X-Git-Url: https://sipb.mit.edu/gitweb.cgi/ikiwiki.git/blobdiff_plain/50faf0b151e08887b686e88d525b3b3e3b5379e5..0f95adbd1d33e267b9654c80ef2d38ca06407ecb:/IkiWiki.pm diff --git a/IkiWiki.pm b/IkiWiki.pm index d001760a2..46060c1b2 100644 --- a/IkiWiki.pm +++ b/IkiWiki.pm @@ -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; } #}}}