mirror of
https://github.com/BookStackApp/BookStack.git
synced 2025-04-16 09:41:05 +00:00

Rolled out HTML editor field and store logic across all target entity types. Cleaned up WYSIWYG input logic and design. Cleaned up some injected classes while there.
21 lines
466 B
PHP
21 lines
466 B
PHP
<?php
|
|
|
|
namespace BookStack\Entities\Models;
|
|
|
|
use BookStack\Util\HtmlContentFilter;
|
|
|
|
/**
|
|
* @property string $description
|
|
* @property string $description_html
|
|
*/
|
|
trait HasHtmlDescription
|
|
{
|
|
/**
|
|
* Get the HTML description for this book.
|
|
*/
|
|
public function descriptionHtml(): string
|
|
{
|
|
$html = $this->description_html ?: '<p>' . e($this->description) . '</p>';
|
|
return HtmlContentFilter::removeScriptsFromHtmlString($html);
|
|
}
|
|
}
|