From: Marcel Werk Date: Fri, 3 Mar 2017 13:48:12 +0000 (+0100) Subject: Allow newlines/paragraphs for article teasers X-Git-Tag: 3.1.0_Alpha_1~616 X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=772d02f59be60854508e146cf6964354660102bb;p=GitHub%2FWoltLab%2FWCF.git Allow newlines/paragraphs for article teasers Closes #2225 --- diff --git a/wcfsetup/install/files/lib/data/article/content/ArticleContent.class.php b/wcfsetup/install/files/lib/data/article/content/ArticleContent.class.php index d25ec43b58..9a0dfc68d7 100644 --- a/wcfsetup/install/files/lib/data/article/content/ArticleContent.class.php +++ b/wcfsetup/install/files/lib/data/article/content/ArticleContent.class.php @@ -76,12 +76,12 @@ class ArticleContent extends DatabaseObject implements ILinkableObject, IRouteCo */ public function getFormattedTeaser() { if ($this->teaser) { - return StringUtil::encodeHTML($this->teaser); + return nl2br(StringUtil::encodeHTML($this->teaser), false); } else { $htmlInputProcessor = new HtmlInputProcessor(); $htmlInputProcessor->processIntermediate($this->content); - return StringUtil::encodeHTML(StringUtil::truncate($htmlInputProcessor->getTextContent(), 500)); + return nl2br(StringUtil::encodeHTML(StringUtil::truncate($htmlInputProcessor->getTextContent(), 500)), false); } }