From a0f70d9819532bca9def088e1089940b2696abf3 Mon Sep 17 00:00:00 2001 From: msquare Date: Wed, 20 Dec 2017 23:21:03 +0100 Subject: solve problem with autobreaks in news text when building html tables --- includes/pages/user_news.php | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) (limited to 'includes/pages/user_news.php') diff --git a/includes/pages/user_news.php b/includes/pages/user_news.php index b51b0a4c..0da49c8e 100644 --- a/includes/pages/user_news.php +++ b/includes/pages/user_news.php @@ -71,6 +71,18 @@ function user_meetings() return $html; } +/** + * Renders the text content of a news entry + * + * @param array $news + * @return string HTML + */ +function news_text($news) { + $text = ReplaceSmilies($news['Text']); + $text = str_replace("\n\n", '

', $text); + return $text; +} + /** * @param array $news * @return string @@ -84,7 +96,7 @@ function display_news($news) $html .= '
'; $html .= '

' . ($news['Treffen'] == 1 ? '[Meeting] ' : '') . ReplaceSmilies($news['Betreff']) . '

'; $html .= '
'; - $html .= '
' . ReplaceSmilies(nl2br($news['Text'])) . '
'; + $html .= '
' . news_text($news) . '
'; $html .= '