1
0
mirror of https://github.com/ezyang/htmlpurifier.git synced 2025-08-04 13:18:00 +02:00

[2.0.1] Add preliminary auto-paragraph implementation. It needs to be aggressively refactored and generalized.

git-svn-id: http://htmlpurifier.org/svnroot/htmlpurifier/trunk@1202 48356398-32a2-884e-a903-53898d9a118a
This commit is contained in:
Edward Z. Yang
2007-06-22 21:32:56 +00:00
parent 03657ad51a
commit eee45fed37
2 changed files with 209 additions and 2 deletions

View File

@@ -74,6 +74,83 @@ class HTMLPurifier_Strategy_MakeWellFormedTest extends HTMLPurifier_StrategyHarn
}
function testAutoParagraph() {
$this->config = array('Core.AutoParagraph' => true);
$this->assertResult(
'Foobar',
'<p>Foobar</p>'
);
$this->assertResult(
'Par 1
Par 1 still',
'<p>Par 1
Par 1 still</p>'
);
$this->assertResult(
'Par1
Par2',
'<p>Par1</p><p>Par2</p>'
);
$this->assertResult(
'<b>Par1</b>
<i>Par2</i>',
'<p><b>Par1</b></p><p><i>Par2</i></p>'
);
$this->assertResult(
'<b>Par1
Par2</b>',
'<p><b>Par1
Par2</b></p>'
);
$this->assertResult(
'Par1<p>Par2</p>',
'<p>Par1</p><p>Par2</p>'
);
$this->assertResult(
'<b>Par1',
'<p><b>Par1</b></p>'
);
$this->assertResult(
'<pre>Par1
Par1</pre>'
);
$this->assertResult(
'Par1
',
'<p>Par1</p>'
);
$this->assertResult(
'Par1
<div>Par2</div>
Par3',
'<p>Par1</p><div>Par2</div><p>Par3</p>'
);
$this->assertResult(
'Par<b>1</b>',
'<p>Par<b>1</b></p>'
);
}
}
?>