Skip to content

Commit

Permalink
Improved fallback creation of article teasers
Browse files Browse the repository at this point in the history
  • Loading branch information
BurntimeX committed Jan 12, 2017
1 parent 04bb2fa commit 45a70ce
Showing 1 changed file with 4 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
use wcf\data\language\Language;
use wcf\data\DatabaseObject;
use wcf\data\ILinkableObject;
use wcf\system\html\input\HtmlInputProcessor;
use wcf\system\html\output\AmpHtmlOutputProcessor;
use wcf\system\html\output\HtmlOutputProcessor;
use wcf\system\language\LanguageFactory;
Expand Down Expand Up @@ -78,7 +79,9 @@ public function getFormattedTeaser() {
return StringUtil::encodeHTML($this->teaser);
}
else {
return StringUtil::truncateHTML(StringUtil::stripHTML($this->getFormattedContent()));
$htmlInputProcessor = new HtmlInputProcessor();
$htmlInputProcessor->processIntermediate($this->content);
return StringUtil::encodeHTML(StringUtil::truncate($htmlInputProcessor->getTextContent(), 500));
}
}

Expand Down

0 comments on commit 45a70ce

Please sign in to comment.