fix bug that left stray </p> tags

Both markdown and tidy add paragraph tags around text, that needs to be
stripped when the text is a short, one line fragment that is being inserted
into a larger page. tidy also adds several newlines to the end, and this
broke removal of the paragraph tags.
master
Joey Hess 2010-04-05 17:18:30 -04:00
parent a01028ae81
commit f8457f9a90
2 changed files with 5 additions and 4 deletions

View 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;

View File

@ -13,3 +13,5 @@ I believe that this snippet in `IkiWiki.pm` might be the reason for the imbalanc
}
The fact that HTML in a `\[[!meta title]]` is added but then escaped might indicate that some other bug is involved.
> [[done]] --[[Joey]]