diff options
author | David Flatz | 2024-04-26 18:19:42 +0200 |
---|---|---|
committer | David Flatz | 2024-04-26 18:19:42 +0200 |
commit | 243879bb340b08b9cc0eee8d988d8025980a390c (patch) | |
tree | d5d0becb5d8f0bebda73ea46ff00c8c2e1b6200c /test | |
parent | c2136d616576a2ff9f36f477870ba32317ac666a (diff) | |
download | itools-243879bb340b08b9cc0eee8d988d8025980a390c.tar.gz itools-243879bb340b08b9cc0eee8d988d8025980a390c.tar.bz2 itools-243879bb340b08b9cc0eee8d988d8025980a390c.zip |
Handle whitespace between attribute name and value; add some TODO tests to be more compliant to specification
Diffstat (limited to 'test')
-rwxr-xr-x | test/it_html.t | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/test/it_html.t b/test/it_html.t index e6477da..80753db 100755 --- a/test/it_html.t +++ b/test/it_html.t @@ -253,6 +253,24 @@ is( 'empty tags removal' ); +is( + it_html::sanitize('<a href = "http://search.ch/">foo</a>'), + '<a href="http://search.ch/">foo</a>', + 'it_html::sanitize handle anchors with spaces between attribute name and value' +); + +is( + it_html::sanitize("<a href='http://search.ch/'>foo</a>"), + '<a href="http://search.ch/">foo</a>', + 'TODO it_html::sanitize handle anchors with single quotes at attribute value' +); + +is( + it_html::sanitize("<a href=index.html>foo</a>"), + '<a href="index.html">foo</a>', + 'TODO it_html::sanitize handle anchors with unquoted attribute value' +); + foreach (json_decode(it::file_get_contents(dirname($argv[0]) . '/U_tests.json'), true) as $test) is(U(...$test['args']), $test['exp'], $test['name']); |