1
0
mirror of https://github.com/BookStackApp/BookStack.git synced 2025-07-31 15:24:31 +03:00

Input WYSIWYG: Aligned newline handling with old descriptions

To ensure consistenent behaviour before/after changes.
Added tests to cover.
This commit is contained in:
Dan Brown
2023-12-20 17:40:58 +00:00
parent a21ca44633
commit ed5d67e609
7 changed files with 37 additions and 4 deletions

View File

@ -15,7 +15,7 @@ trait HasHtmlDescription
*/
public function descriptionHtml(): string
{
$html = $this->description_html ?: '<p>' . e($this->description) . '</p>';
$html = $this->description_html ?: '<p>' . nl2br(e($this->description)) . '</p>';
return HtmlContentFilter::removeScriptsFromHtmlString($html);
}
}