Minor fixes

This commit is contained in:
David Bomba 2025-02-26 17:43:39 +11:00
parent 19f726d54a
commit b32c9f4749
1 changed files with 2 additions and 2 deletions

View File

@ -2048,7 +2048,7 @@ class PdfBuilder
*/ */
private function isMarkdown(string $content): bool private function isMarkdown(string $content): bool
{ {
$content = str_ireplace('<br>', "\n", $content); $content = str_ireplace(['<br>', '<br/>', '<br />'], "\n", $content);
$markdownPatterns = [ $markdownPatterns = [
'/^\s*#{1,6}\s/m', // Headers '/^\s*#{1,6}\s/m', // Headers
@ -2088,7 +2088,7 @@ class PdfBuilder
$child['content'] = $child['content'] ?? ''; $child['content'] = $child['content'] ?? '';
if ($this->service->company->markdown_enabled && $this->isMarkdown($child['content'])) { if ($this->service->company->markdown_enabled && $this->isMarkdown($child['content'])) {
$child['content'] = str_ireplace('<br>', "\r", $child['content']); $child['content'] = str_ireplace(['<br>', '<br/>', '<br />'], "\r", $child['content']);
$child['content'] = $this->commonmark->convert($child['content']); //@phpstan-ignore-line $child['content'] = $this->commonmark->convert($child['content']); //@phpstan-ignore-line
} }