summaryrefslogtreecommitdiff
path: root/it_html.class
diff options
context:
space:
mode:
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)));