diff options
Diffstat (limited to 'IkiWiki.pm')
-rw-r--r-- | IkiWiki.pm | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/IkiWiki.pm b/IkiWiki.pm index d001760a2..230170d85 100644 --- a/IkiWiki.pm +++ b/IkiWiki.pm @@ -624,12 +624,22 @@ sub htmlize ($$$) { #{{{ error("htmlization of $type not supported"); } + my $oneline = $content !~ /\n/; + run_hooks(sanitize => sub { $content=shift->( page => $page, content => $content, ); }); + + if ($oneline) { + # hack to get rid of enclosing junk added by markdown + # and other htmlizers + $content=~s/^<p>//i; + $content=~s/<\/p>$//i; + chomp $content; + } return $content; } #}}} |