Merge remote branch 'smcv/ready/link-types'
[ikiwiki.git] / IkiWiki.pm
index 6ea0fb3f358c1fc48551db2ea9f3af9a363b1ff6..2415307d456b1f0b2aabcdaa569666e33337475c 100644 (file)
@@ -1164,7 +1164,7 @@ sub htmlize ($$$$) {
        my $content=shift;
        
        my $oneline = $content !~ /\n/;
-
+       
        if (exists $hooks{htmlize}{$type}) {
                $content=$hooks{htmlize}{$type}{call}->(
                        page => $page,
@@ -1185,10 +1185,9 @@ sub htmlize ($$$$) {
        
        if ($oneline) {
                # hack to get rid of enclosing junk added by markdown
-               # and other htmlizers
+               # and other htmlizers/sanitizers
                $content=~s/^<p>//i;
-               $content=~s/<\/p>$//i;
-               chomp $content;
+               $content=~s/<\/p>\n*$//i;
        }
 
        return $content;