summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorDavid Flatz2024-05-27 13:27:39 +0200
committerDavid Flatz2024-05-27 13:27:39 +0200
commitb484fab88a9229f7c87ea053564d0d8d3d2a565d (patch)
treef9395fc1b9908cdcf9e54aad1de6c8f97406a03f /test
parent8c86436125d34e1dc322c475f7d460cad682cdd7 (diff)
downloaditools-b484fab88a9229f7c87ea053564d0d8d3d2a565d.tar.gz
itools-b484fab88a9229f7c87ea053564d0d8d3d2a565d.tar.bz2
itools-b484fab88a9229f7c87ea053564d0d8d3d2a565d.zip
Improve handling of nested tags in it_html::sanitize
Diffstat (limited to 'test')
-rwxr-xr-xtest/it_html.t12
1 files changed, 12 insertions, 0 deletions
diff --git a/test/it_html.t b/test/it_html.t
index 11e05dd..380a779 100755
--- a/test/it_html.t
+++ b/test/it_html.t
@@ -289,6 +289,18 @@ is(
'TODO it_html::sanitize handle anchors with unquoted attribute value in img'
);
+is(
+ it_html::sanitize('<ul><li><ul><li class="removeme">foo</li><li>bar</li></ul></li></ul>'),
+ '<ul><li><ul><li>foo</li><li>bar</li></ul></li></ul>',
+ 'Nested unordered lists'
+);
+
+is(
+ it_html::sanitize('<p><b>one</b> one</p><ul><li><p><i>one-one</i></p><ul><li>one-one-one</li><li>one-one-two</li></ul></li><li><p><i>one-two</i></p><ul><li>one-two-one</li><li>one-two-two</li></ul></li></ul>'),
+ '<p><b>one</b> one</p><ul><li><p><i>one-one</i></p><ul><li>one-one-one</li><li>one-one-two</li></ul></li><li><p><i>one-two</i></p><ul><li>one-two-one</li><li>one-two-two</li></ul></li></ul>',
+ 'More nested tags'
+);
+
foreach (json_decode(it::file_get_contents(dirname($argv[0]) . '/U_tests.json'), true) as $test)
is(U(...$test['args']), $test['exp'], $test['name']);