diff options
author | Thomas BrĂ¼derli | 2008-11-25 10:37:26 +0000 |
---|---|---|
committer | Thomas BrĂ¼derli | 2008-11-25 10:37:26 +0000 |
commit | bb671acbe075d93844c6d8ffeef3bcd94019f805 (patch) | |
tree | a736e80d06685342c37252c204fba515b9329f43 /it_html.class | |
parent | 9adec4da37b8f59957f89165520109da9563d430 (diff) | |
download | itools-bb671acbe075d93844c6d8ffeef3bcd94019f805.tar.gz itools-bb671acbe075d93844c6d8ffeef3bcd94019f805.tar.bz2 itools-bb671acbe075d93844c6d8ffeef3bcd94019f805.zip |
Convert table rows to simple line breaks
Diffstat (limited to 'it_html.class')
-rw-r--r-- | it_html.class | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/it_html.class b/it_html.class index c4cb187..9debd34 100644 --- a/it_html.class +++ b/it_html.class @@ -397,12 +397,11 @@ function sanitize($html) list($head, $src, $tail) = $tag; $result .= it_html::sanitize($head) . '<img src="' . it_html::Q(html_entity_decode($src, ENT_COMPAT, $charset)) . '" alt="" />' . it_html::sanitize($tail); } - else if ($tag = it::match("(.*)<(br)[^>]*>(.*)", $html)) + else if ($tag = it::match("(.*)<(br|/tr)[^>]*>(.*)", $html)) { - # Simple tags without content, no attributes kept + # brs and table rows are converted so simple line breaks list($head, $tagname, $tail) = $tag; - $tagname = strtolower($tagname); - $result .= it_html::sanitize($head) . "<$tagname />" . it_html::sanitize($tail); + $result .= it_html::sanitize($head) . "<br />" . it_html::sanitize($tail); } else $result = it_html::Q(it::replace(array('&#\d+;' => ""), html_entity_decode(strip_tags($html), ENT_COMPAT, $charset))); |