diff --git a/app/Services/PdfMaker/Designs/Utilities/DesignHelpers.php b/app/Services/PdfMaker/Designs/Utilities/DesignHelpers.php index 82bbc3db684f..f2f61cc68240 100644 --- a/app/Services/PdfMaker/Designs/Utilities/DesignHelpers.php +++ b/app/Services/PdfMaker/Designs/Utilities/DesignHelpers.php @@ -382,22 +382,23 @@ document.addEventListener('DOMContentLoaded', function() { return $converter->convertToHtml($markdown); } - public function processMarkdownOnLineItems(array &$items): void - { - foreach ($items as $key => $item) { - foreach ($item as $variable => $value) { - $item[$variable] = DesignHelpers::parseMarkdownToHtml($value ?? ''); - } + // public function processMarkdownOnLineItems(array &$items): void + // { + // foreach ($items as $key => $item) { + // foreach ($item as $variable => $value) { + // $item[$variable] = DesignHelpers::parseMarkdownToHtml($value ?? ''); + // } - $items[$key] = $item; - } - } + // $items[$key] = $item; + // } + // } public function processNewLines(array &$items): void { foreach ($items as $key => $item) { foreach ($item as $variable => $value) { - $item[$variable] = nl2br($value); + // $item[$variable] = nl2br($value, true); + $item[$variable] = str_replace( "\n", '
', $value); } $items[$key] = $item; diff --git a/app/Services/PdfMaker/PdfMaker.php b/app/Services/PdfMaker/PdfMaker.php index ec492cf8e5a3..a38cf18e61ef 100644 --- a/app/Services/PdfMaker/PdfMaker.php +++ b/app/Services/PdfMaker/PdfMaker.php @@ -51,6 +51,7 @@ class PdfMaker $this->commonmark = new CommonMarkConverter([ 'allow_unsafe_links' => false, + // 'html_input' => 'allow', ]); } diff --git a/app/Services/PdfMaker/PdfMakerUtilities.php b/app/Services/PdfMaker/PdfMakerUtilities.php index ab72d76d3745..06817df0e949 100644 --- a/app/Services/PdfMaker/PdfMakerUtilities.php +++ b/app/Services/PdfMaker/PdfMakerUtilities.php @@ -92,7 +92,9 @@ trait PdfMakerUtilities $contains_html = false; if ($child['element'] !== 'script') { - if (array_key_exists('process_markdown', $this->data) && $this->data['process_markdown']) { + if (array_key_exists('process_markdown', $this->data) && array_key_exists('content', $child) && $this->data['process_markdown']) { + + $child['content'] = str_replace("
", "\r", $child['content']); $child['content'] = $this->commonmark->convertToHtml($child['content'] ?? ''); } } diff --git a/composer.json b/composer.json index f58ba6ad8c22..877931817fe1 100644 --- a/composer.json +++ b/composer.json @@ -44,7 +44,6 @@ "eway/eway-rapid-php": "^1.3", "fakerphp/faker": "^1.14", "fideloper/proxy": "^4.2", - "firebase/php-jwt": "^5", "fruitcake/laravel-cors": "^2.0", "gocardless/gocardless-pro": "^4.12", "google/apiclient": "^2.7",