This commit is contained in:
Mohammad 2025-10-06 06:03:16 +02:00 committed by GitHub
commit abc2792dc2
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -13,6 +13,7 @@ trait HtmlDescriptionTrait
public function descriptionHtml(bool $raw = false): string
{
$html = $this->description_html ?: '<p>' . nl2br(e($this->description)) . '</p>';
$html = preg_replace('/<p>(\s|&nbsp;|<br\s*\/?>)*<\/p>/i', '', $html);
if ($raw) {
return $html;
}