diff options
author | Joey Hess <joey@kodama.kitenet.net> | 2008-01-09 14:41:28 -0500 |
---|---|---|
committer | Joey Hess <joey@kodama.kitenet.net> | 2008-01-09 14:41:28 -0500 |
commit | e01960e90aae4185771719e9eed00b23d43431a7 (patch) | |
tree | 65e4f88e717790fd1cae39d8471f8fad5f528563 /IkiWiki.pm | |
parent | 2b9ce0129bc61177e976caf432af9b4406ab2f3f (diff) |
not only markdown adds gunk, so remove it in the main htmlize function
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; } #}}} |