From bb671acbe075d93844c6d8ffeef3bcd94019f805 Mon Sep 17 00:00:00 2001 From: Thomas BrĂ¼derli Date: Tue, 25 Nov 2008 10:37:26 +0000 Subject: Convert table rows to simple line breaks --- it_html.class | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) (limited to 'it_html.class') 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) . '' . 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) . "
" . it_html::sanitize($tail); } else $result = it_html::Q(it::replace(array('&#\d+;' => ""), html_entity_decode(strip_tags($html), ENT_COMPAT, $charset))); -- cgit v1.2.3