From bb45b5f55b7ca357a45173cf8292be2d8bd2062f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Benjamin=20Beganovi=C4=87?= Date: Fri, 4 Jun 2021 13:26:06 +0200 Subject: [PATCH 1/3] Disable markdown processing for line items --- app/Services/PdfMaker/Design.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/Services/PdfMaker/Design.php b/app/Services/PdfMaker/Design.php index e5ac416f8897..65012b08bab2 100644 --- a/app/Services/PdfMaker/Design.php +++ b/app/Services/PdfMaker/Design.php @@ -346,7 +346,7 @@ class Design extends BaseDesign $items = $this->transformLineItems($this->entity->line_items, $type); - $this->processMarkdownOnLineItems($items); +// $this->processMarkdownOnLineItems($items); if (count($items) == 0) { return []; From a52cdca1e36be2db743d824abea173b86c041be5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Benjamin=20Beganovi=C4=87?= Date: Fri, 4 Jun 2021 13:26:32 +0200 Subject: [PATCH 2/3] Parse break lines inputs from user --- app/Services/PdfMaker/PdfMakerUtilities.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/Services/PdfMaker/PdfMakerUtilities.php b/app/Services/PdfMaker/PdfMakerUtilities.php index bc7df97a6136..d243669c326c 100644 --- a/app/Services/PdfMaker/PdfMakerUtilities.php +++ b/app/Services/PdfMaker/PdfMakerUtilities.php @@ -95,7 +95,7 @@ trait PdfMakerUtilities // Commented cause it keeps adding
at the end, if markdown parsing is turned on. // Should update with 'parse_markdown_on_pdfs' setting. - // $child['content'] = nl2br($child['content']); + $child['content'] = nl2br($child['content']); } // "/\/[a-z]*>/i" -> checks for HTML-like tags: From a55142acd9fef8267699065513015d8e860bdfeb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Benjamin=20Beganovi=C4=87?= Date: Fri, 4 Jun 2021 13:28:12 +0200 Subject: [PATCH 3/3] Don't parse markdown for footer, public notes & terms --- app/Utils/HtmlEngine.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/app/Utils/HtmlEngine.php b/app/Utils/HtmlEngine.php index 7173e5eeca0e..2e0f6c13ee0d 100644 --- a/app/Utils/HtmlEngine.php +++ b/app/Utils/HtmlEngine.php @@ -122,7 +122,7 @@ class HtmlEngine if ($this->entity_string == 'invoice' || $this->entity_string == 'recurring_invoice') { $data['$entity'] = ['value' => '', 'label' => ctrans('texts.invoice')]; $data['$number'] = ['value' => $this->entity->number ?: ' ', 'label' => ctrans('texts.invoice_number')]; - $data['$entity.terms'] = ['value' => DesignHelpers::parseMarkdownToHtml($this->entity->terms ?: '') ?: '', 'label' => ctrans('texts.invoice_terms')]; + $data['$entity.terms'] = ['value' => $this->entity->terms ?: '', 'label' => ctrans('texts.invoice_terms')]; $data['$terms'] = &$data['$entity.terms']; $data['$view_link'] = ['value' => ''.ctrans('texts.view_invoice').'', 'label' => ctrans('texts.view_invoice')]; $data['$view_url'] = ['value' => $this->invitation->getLink(), 'label' => ctrans('texts.view_invoice')]; @@ -201,7 +201,7 @@ class HtmlEngine $data['$invoice.custom2'] = ['value' => $this->helpers->formatCustomFieldValue($this->company->custom_fields, 'invoice2', $this->entity->custom_value2, $this->client) ?: ' ', 'label' => $this->helpers->makeCustomField($this->company->custom_fields, 'invoice2')]; $data['$invoice.custom3'] = ['value' => $this->helpers->formatCustomFieldValue($this->company->custom_fields, 'invoice3', $this->entity->custom_value3, $this->client) ?: ' ', 'label' => $this->helpers->makeCustomField($this->company->custom_fields, 'invoice3')]; $data['$invoice.custom4'] = ['value' => $this->helpers->formatCustomFieldValue($this->company->custom_fields, 'invoice4', $this->entity->custom_value4, $this->client) ?: ' ', 'label' => $this->helpers->makeCustomField($this->company->custom_fields, 'invoice4')]; - $data['$invoice.public_notes'] = ['value' => DesignHelpers::parseMarkdownToHtml($this->entity->public_notes ?: '') ?: '', 'label' => ctrans('texts.public_notes')]; + $data['$invoice.public_notes'] = ['value' => $this->entity->public_notes ?: '', 'label' => ctrans('texts.public_notes')]; $data['$entity.public_notes'] = &$data['$invoice.public_notes']; $data['$public_notes'] = &$data['$invoice.public_notes']; @@ -380,7 +380,7 @@ class HtmlEngine $data['$description'] = ['value' => '', 'label' => ctrans('texts.description')]; //$data['$entity_footer'] = ['value' => $this->client->getSetting("{$this->entity_string}_footer"), 'label' => '']; - $data['$entity_footer'] = ['value' => DesignHelpers::parseMarkdownToHtml($this->entity->footer ?: ''), 'label' => '']; + $data['$entity_footer'] = ['value' => $this->entity->footer, 'label' => '']; $data['$page_size'] = ['value' => $this->settings->page_size, 'label' => '']; $data['$page_layout'] = ['value' => property_exists($this->settings, 'page_layout') ? $this->settings->page_layout : 'Portrait', 'label' => ''];