diff options
author | Christian Schneider | 2007-02-15 01:47:00 +0000 |
---|---|---|
committer | Christian Schneider | 2007-02-15 01:47:00 +0000 |
commit | f857093ca98c784c01064f30b5ab08e68d98a868 (patch) | |
tree | 834dca85d2fa0bf9f50e3c8062b4223b441e2aab | |
parent | d356adc84daa5c8648a9f04bca60557789067026 (diff) | |
download | itools-f857093ca98c784c01064f30b5ab08e68d98a868.tar.gz itools-f857093ca98c784c01064f30b5ab08e68d98a868.tar.bz2 itools-f857093ca98c784c01064f30b5ab08e68d98a868.zip |
Added empty alt tag to make validator happy
-rw-r--r-- | html.class | 2 | ||||
-rwxr-xr-x | tests/html.t | 2 |
2 files changed, 2 insertions, 2 deletions
@@ -254,7 +254,7 @@ function sanitize($html) { # Image tags, keeps only src attribute list($head, $src, $tail) = $tag; - $result .= it_html::sanitize($head) . "<img src=\"$src\" />" . it_html::sanitize($tail); + $result .= it_html::sanitize($head) . "<img src=\"$src\" alt=\"\" />" . it_html::sanitize($tail); } else if ($tag = it::match("(.*)<(br)[^>]*>(.*)", $html)) { diff --git a/tests/html.t b/tests/html.t index 071685e..965e4a1 100755 --- a/tests/html.t +++ b/tests/html.t @@ -85,7 +85,7 @@ is( <p><a href="javascript:window.close()" title="Wolken"><img src="http://farm1.static.flickr.com/177/377214376_bcba167a7d_m.jpg" width="240" height="180" alt="Wolken" style="border: 1px solid #ddd;" /></a></p> '), - ' <a href="http://www.flickr.com/people/swisspics/">swisspics</a> posted < < ä & yesterday a <i>photo</i> <i>tag missmatch</i>:<br /><br /> <p><img src="http://farm1.static.flickr.com/177/377214376_bcba167a7d_m.jpg" /></p> ', + ' <a href="http://www.flickr.com/people/swisspics/">swisspics</a> posted < < ä & yesterday a <i>photo</i> <i>tag missmatch</i>:<br /><br /> <p><img src="http://farm1.static.flickr.com/177/377214376_bcba167a7d_m.jpg" alt="" /></p> ', 'it_html::sanitize tag soup' ); |