1
0
mirror of https://github.com/ezyang/htmlpurifier.git synced 2025-08-06 14:16:32 +02:00

- Implement double-checking in Strategy/FixNesting.php, fixes the table bugs.

- Move around child definitions so they make a little more sense (rename to Custom) and also add $allow_empty property to help FixNesting.php determine whether or not to double-check.

git-svn-id: http://htmlpurifier.org/svnroot/htmlpurifier/trunk@136 48356398-32a2-884e-a903-53898d9a118a
This commit is contained in:
Edward Z. Yang
2006-07-31 03:04:57 +00:00
parent 9c6ae16764
commit 9d411bd5cc
5 changed files with 87 additions and 42 deletions

View File

@@ -38,9 +38,29 @@ class HTMLPurifier_Strategy_FixNestingTest
$expect[4] = '<ul><li>Legal item</li></ul>';
// test custom table definition
$inputs[5] = '<table><tr><td>Cell 1</td></tr></table>';
$expect[5] = '<table><tr><td>Cell 1</td></tr></table>';
$inputs[6] = '<table></table>';
$expect[6] = '';
// breaks without the redundant checking code
$inputs[7] = '<table><tr></tr></table>';
$expect[7] = '';
// special case, prevents scrolling one back to find parent
$inputs[8] = '<table><tr></tr><tr></tr></table>';
$expect[8] = '';
// cascading rollbacks
$inputs[9] = '<table><tbody><tr></tr><tr></tr></tbody><tr></tr><tr></tr></table>';
$expect[9] = '';
// rollbacks twice
$inputs[10] = '<table></table><table></table>';
$expect[10] = '';
$this->assertStrategyWorks($strategy, $inputs, $expect);
}