mirror of
https://github.com/ezyang/htmlpurifier.git
synced 2025-08-06 06:07:26 +02:00
Properly handle nested sublists by folding into previous list item.
Signed-off-by: Edward Z. Yang <ezyang@mit.edu>
This commit is contained in:
@@ -35,10 +35,17 @@ class HTMLPurifier_Strategy_FixNestingTest extends HTMLPurifier_StrategyHarness
|
||||
$this->assertResult('<ul></ul>', '');
|
||||
}
|
||||
|
||||
function testRemoveIllegalPCDATA() {
|
||||
function testListHandleIllegalPCDATA() {
|
||||
$this->assertResult(
|
||||
'<ul>Illegal text<li>Legal item</li></ul>',
|
||||
'<ul><li>Legal item</li></ul>'
|
||||
'<ul><li>Illegal text</li><li>Legal item</li></ul>'
|
||||
);
|
||||
}
|
||||
|
||||
function testRemoveIllegalPCDATA() {
|
||||
$this->assertResult(
|
||||
'<table><tr>Illegal text<td></td></tr></table>',
|
||||
'<table><tr><td></td></tr></table>'
|
||||
);
|
||||
}
|
||||
|
||||
|
@@ -119,21 +119,21 @@ class HTMLPurifier_Strategy_MakeWellFormedTest extends HTMLPurifier_StrategyHarn
|
||||
function testNestedOl() {
|
||||
$this->assertResult(
|
||||
'<ol><ol><li>foo</li></ol></ol>',
|
||||
'<ol><li><ol><li>foo</li></ol></li></ol>'
|
||||
'<ol><ol><li>foo</li></ol></ol>'
|
||||
);
|
||||
}
|
||||
|
||||
function testNestedUl() {
|
||||
$this->assertResult(
|
||||
'<ul><ul><li>foo</li></ul></ul>',
|
||||
'<ul><li><ul><li>foo</li></ul></li></ul>'
|
||||
'<ul><ul><li>foo</li></ul></ul>'
|
||||
);
|
||||
}
|
||||
|
||||
function testNestedOlWithStrangeEnding() {
|
||||
$this->assertResult(
|
||||
'<ol><li><ol><ol><li>foo</li></ol></li><li>foo</li></ol>',
|
||||
'<ol><li><ol><li><ol><li>foo</li></ol></li><li>foo</li></ol></li></ol>'
|
||||
'<ol><li><ol><ol><li>foo</li></ol></ol></li><li>foo</li></ol>'
|
||||
);
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user