1
0
mirror of https://github.com/ezyang/htmlpurifier.git synced 2025-07-31 03:10:09 +02:00

Fix broken table content model, easily seen in XHTML1.1

Signed-off-by: Edward Z. Yang <ezyang@mit.edu>
This commit is contained in:
Edward Z. Yang
2011-12-26 14:49:26 +08:00
parent 3570c9985a
commit e41af46a8b
4 changed files with 111 additions and 6 deletions

View File

@@ -28,7 +28,21 @@ class HTMLPurifier_ChildDef_TableTest extends HTMLPurifier_ChildDefHarness
function testReorderContents() {
$this->assertResult(
'<col /><colgroup /><tbody /><tfoot /><thead /><tr>1</tr><caption /><tr />',
'<caption /><col /><colgroup /><thead /><tfoot /><tbody /><tr>1</tr><tr />');
'<caption /><col /><colgroup /><thead /><tfoot /><tbody /><tbody><tr>1</tr><tr /></tbody>');
}
function testXhtml11Illegal() {
$this->assertResult(
'<thead><tr><th>a</th></tr></thead><tr><td>a</td></tr>',
'<thead><tr><th>a</th></tr></thead><tbody><tr><td>a</td></tr></tbody>'
);
}
function testTrOverflowAndClose() {
$this->assertResult(
'<tr><td>a</td></tr><tr><td>b</td></tr><tbody><tr><td>c</td></tr></tbody><tr><td>d</td></tr>',
'<tbody><tr><td>a</td></tr><tr><td>b</td></tr></tbody><tbody><tr><td>c</td></tr></tbody><tbody><tr><td>d</td></tr></tbody>'
);
}
function testDuplicateProcessing() {