1
0
mirror of https://github.com/ezyang/htmlpurifier.git synced 2025-08-01 11:50:28 +02:00

Implement %AutoFormat.RemoveEmpty.RemoveNbsp, by popular demand.

Signed-off-by: Edward Z. Yang <edwardzyang@thewritingpot.com>
This commit is contained in:
Edward Z. Yang
2009-04-09 00:53:19 -04:00
parent 398a02039e
commit e3c2063f69
8 changed files with 67 additions and 4 deletions

View File

@@ -54,6 +54,27 @@ class HTMLPurifier_Injector_RemoveEmptyTest extends HTMLPurifier_InjectorHarness
$this->assertResult('<b> <i> <u> </u> </i> </b>', '');
}
function testRemoveNbsp() {
$this->config->set('AutoFormat.RemoveEmpty.RemoveNbsp', true);
$this->assertResult('<b>&nbsp;</b>', '');
}
function testRemoveNbspMix() {
$this->config->set('AutoFormat.RemoveEmpty.RemoveNbsp', true);
$this->assertResult('<b>&nbsp; &nbsp;</b>', '');
}
function testDontRemoveNbsp() {
$this->config->set('AutoFormat.RemoveEmpty.RemoveNbsp', true);
$this->assertResult('<td>&nbsp;</b>', "<td>\xC2\xA0</td>");
}
function testRemoveNbspExceptionsSpecial() {
$this->config->set('AutoFormat.RemoveEmpty.RemoveNbsp', true);
$this->config->set('AutoFormat.RemoveEmpty.RemoveNbsp.Exceptions', 'b');
$this->assertResult('<b>&nbsp;</b>', "<b>\xC2\xA0</b>");
}
}
// vim: et sw=4 sts=4