mirror of
https://github.com/ezyang/htmlpurifier.git
synced 2024-12-22 08:21:52 +00:00
Fixed Issue #264: <thead> element removed from <table> if there are no <tbody> or <tr> elements (#283)
This commit is contained in:
parent
2512f595e0
commit
214cb8a693
@ -164,7 +164,7 @@ class HTMLPurifier_ChildDef_Table extends HTMLPurifier_ChildDef
|
||||
}
|
||||
}
|
||||
|
||||
if (empty($content)) {
|
||||
if (empty($content) && $thead === false && $tfoot === false) {
|
||||
return false;
|
||||
}
|
||||
|
||||
|
@ -44,6 +44,22 @@ class HTMLPurifier_ChildDef_TableTest extends HTMLPurifier_ChildDefHarness
|
||||
);
|
||||
}
|
||||
|
||||
public function testTheadOnlyNotRemoved()
|
||||
{
|
||||
$this->assertResult(
|
||||
'<thead><tr><th>a</th></tr></thead>',
|
||||
'<thead><tr><th>a</th></tr></thead>'
|
||||
);
|
||||
}
|
||||
|
||||
public function testTbodyOnlyNotRemoved()
|
||||
{
|
||||
$this->assertResult(
|
||||
'<tbody><tr><th>a</th></tr></tbody>',
|
||||
'<tbody><tr><th>a</th></tr></tbody>'
|
||||
);
|
||||
}
|
||||
|
||||
public function testTrOverflowAndClose()
|
||||
{
|
||||
$this->assertResult(
|
||||
|
Loading…
Reference in New Issue
Block a user