summaryrefslogtreecommitdiff
path: root/it_html.class
diff options
context:
space:
mode:
authorThomas BrĂ¼derli2008-11-25 10:37:26 +0000
committerThomas BrĂ¼derli2008-11-25 10:37:26 +0000
commitbb671acbe075d93844c6d8ffeef3bcd94019f805 (patch)
treea736e80d06685342c37252c204fba515b9329f43 /it_html.class
parent9adec4da37b8f59957f89165520109da9563d430 (diff)
downloaditools-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.class7
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)));