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:
@@ -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> </b>', '');
|
||||
}
|
||||
|
||||
function testRemoveNbspMix() {
|
||||
$this->config->set('AutoFormat.RemoveEmpty.RemoveNbsp', true);
|
||||
$this->assertResult('<b> </b>', '');
|
||||
}
|
||||
|
||||
function testDontRemoveNbsp() {
|
||||
$this->config->set('AutoFormat.RemoveEmpty.RemoveNbsp', true);
|
||||
$this->assertResult('<td> </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> </b>', "<b>\xC2\xA0</b>");
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
// vim: et sw=4 sts=4
|
||||
|
Reference in New Issue
Block a user