aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJoey Hess <joey@gnu.kitenet.net>2010-04-05 17:18:30 -0400
committerJoey Hess <joey@gnu.kitenet.net>2010-04-05 17:18:30 -0400
commitf8457f9a902e880e0240ba7f5180c22999f0e713 (patch)
tree2ca6c53d8b710733f262fb3fc269518df7a9cb75
parenta01028ae8156679a108a40c62aa6b4cc3e2b3ae7 (diff)
downloadikiwiki-f8457f9a902e880e0240ba7f5180c22999f0e713.tar
ikiwiki-f8457f9a902e880e0240ba7f5180c22999f0e713.tar.gz
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.
-rw-r--r--IkiWiki.pm7
-rw-r--r--doc/bugs/stray___60____47__p__62___tags.mdwn2
2 files changed, 5 insertions, 4 deletions
diff --git a/IkiWiki.pm b/IkiWiki.pm
index 6739ba56c..0cbc84788 100644
--- a/IkiWiki.pm
+++ b/IkiWiki.pm
@@ -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;
diff --git a/doc/bugs/stray___60____47__p__62___tags.mdwn b/doc/bugs/stray___60____47__p__62___tags.mdwn
index 6e508ffda..99d6fe09f 100644
--- a/doc/bugs/stray___60____47__p__62___tags.mdwn
+++ b/doc/bugs/stray___60____47__p__62___tags.mdwn
@@ -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]]