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 /it_html.class | |
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 'it_html.class')
-rw-r--r-- | it_html.class | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/it_html.class b/it_html.class index a4a4ab5..44a2137 100644 --- a/it_html.class +++ b/it_html.class @@ -415,7 +415,7 @@ static function sanitize($html) $tagname = strtolower($tagname); $result .= it_html::sanitize($head) . "<$tagname>" . it_html::sanitize($content) . "</$tagname>" . it_html::sanitize($tail); } - else if ($tag = it::match('(.*)<a\b[^>]+?href="(' . $urlpattern . ')"[^>]*?>(.*?)</a>(.*)', $html)) + else if ($tag = it::match('(.*)<a\b[^>]+?\bhref\s*=\s*"(' . $urlpattern . ')"[^>]*?>(.*?)</a>(.*)', $html)) { # Link tags, keeps only href attribute list($head, $href, $content, $tail) = $tag; |