From e01960e90aae4185771719e9eed00b23d43431a7 Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Wed, 9 Jan 2008 14:41:28 -0500 Subject: not only markdown adds gunk, so remove it in the main htmlize function --- IkiWiki.pm | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'IkiWiki.pm') 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/^

//i; + $content=~s/<\/p>$//i; + chomp $content; + } return $content; } #}}} -- cgit v1.2.3