0
0
mirror of https://github.com/ezyang/htmlpurifier.git synced 2024-09-19 10:45:18 +00:00

[2.1.0] Fix another AutoParagraph edge-case.

git-svn-id: http://htmlpurifier.org/svnroot/htmlpurifier/trunk@1295 48356398-32a2-884e-a903-53898d9a118a
This commit is contained in:
Edward Z. Yang 2007-06-29 17:48:56 +00:00
parent fab6a212c8
commit 733868a76d
2 changed files with 13 additions and 1 deletions

View File

@ -166,7 +166,14 @@ class HTMLPurifier_Injector_AutoParagraph extends HTMLPurifier_Injector
$needs_start = false;
$needs_end = false;
for ($i = 0, $c = count($raw_paragraphs); $i < $c; $i++) {
$c = count($raw_paragraphs);
if ($c == 1) {
// there were no double-newlines, abort quickly
$result[] = new HTMLPurifier_Token_Text($data);
return;
}
for ($i = 0; $i < $c; $i++) {
$par = $raw_paragraphs[$i];
if (trim($par) !== '') {
$paragraphs[] = $par;

View File

@ -261,6 +261,11 @@ Par1
'<div><div>asdf</div><p><b>asdf</b></p></div>'
);
$this->assertResult(
'<b>One</b> <i>Two</i>',
'<p><b>One</b> <i>Two</i></p>'
);
}
function testInlineRootNode() {