summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorDavid Flatz2024-04-29 08:38:04 +0200
committerDavid Flatz2024-04-29 08:38:04 +0200
commitb0a622196a793a36bdf77f79185acea85ba39730 (patch)
treef940ba5f709864d1c32e3c5d62ae3261b4728a7f /test
parent1750fccd215ed2606053fdc804420469b42758c1 (diff)
downloaditools-b0a622196a793a36bdf77f79185acea85ba39730.tar.gz
itools-b0a622196a793a36bdf77f79185acea85ba39730.tar.bz2
itools-b0a622196a793a36bdf77f79185acea85ba39730.zip
Handle whitespace between attribute name and value also for img tags
Diffstat (limited to 'test')
-rwxr-xr-xtest/it_html.t18
1 files changed, 18 insertions, 0 deletions
diff --git a/test/it_html.t b/test/it_html.t
index 4fef25d..11e05dd 100755
--- a/test/it_html.t
+++ b/test/it_html.t
@@ -271,6 +271,24 @@ is(
'TODO it_html::sanitize handle anchors with unquoted attribute value'
);
+is(
+ it_html::sanitize('<img src = "http://search.ch/logo.jpg">'),
+ '<img src="http://search.ch/logo.jpg" alt="" />',
+ 'it_html::sanitize handle anchors with spaces between attribute name and value in img'
+);
+
+is(
+ it_html::sanitize("<img src='http://search.ch/logo.jpg'/>"),
+ '<img src="http://search.ch/logo.jpg" alt="" />',
+ 'TODO it_html::sanitize handle anchors with single quotes at attribute value in img'
+);
+
+is(
+ it_html::sanitize("<img src=http://search.ch/logo.jpg>"),
+ '<img src="http://search.ch/logo.jpg" alt="" />',
+ 'TODO it_html::sanitize handle anchors with unquoted attribute value in img'
+);
+
foreach (json_decode(it::file_get_contents(dirname($argv[0]) . '/U_tests.json'), true) as $test)
is(U(...$test['args']), $test['exp'], $test['name']);