mirror of
https://github.com/invoiceninja/invoiceninja.git
synced 2025-07-09 03:14:30 -04:00
Merge pull request #6436 from beganovich/v5-markdown-spacing
(v5) Fixes for markdown spacing
This commit is contained in:
commit
ad7440bc84
@ -348,6 +348,8 @@ class Design extends BaseDesign
|
|||||||
|
|
||||||
$items = $this->transformLineItems($this->entity->line_items, $type);
|
$items = $this->transformLineItems($this->entity->line_items, $type);
|
||||||
|
|
||||||
|
$this->processNewLines($items);
|
||||||
|
|
||||||
if (count($items) == 0) {
|
if (count($items) == 0) {
|
||||||
return [];
|
return [];
|
||||||
}
|
}
|
||||||
|
@ -331,7 +331,7 @@ document.addEventListener('DOMContentLoaded', function() {
|
|||||||
return $converter->convertToHtml($markdown);
|
return $converter->convertToHtml($markdown);
|
||||||
}
|
}
|
||||||
|
|
||||||
public function processMarkdownOnLineItems(array &$items)
|
public function processMarkdownOnLineItems(array &$items): void
|
||||||
{
|
{
|
||||||
foreach ($items as $key => $item) {
|
foreach ($items as $key => $item) {
|
||||||
foreach ($item as $variable => $value) {
|
foreach ($item as $variable => $value) {
|
||||||
@ -341,4 +341,15 @@ document.addEventListener('DOMContentLoaded', function() {
|
|||||||
$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);
|
||||||
|
}
|
||||||
|
|
||||||
|
$items[$key] = $item;
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
@ -94,8 +94,6 @@ trait PdfMakerUtilities
|
|||||||
if ($child['element'] !== 'script') {
|
if ($child['element'] !== 'script') {
|
||||||
if (array_key_exists('process_markdown', $this->data) && $this->data['process_markdown']) {
|
if (array_key_exists('process_markdown', $this->data) && $this->data['process_markdown']) {
|
||||||
$child['content'] = $this->commonmark->convertToHtml($child['content'] ?? '');
|
$child['content'] = $this->commonmark->convertToHtml($child['content'] ?? '');
|
||||||
} else {
|
|
||||||
$child['content'] = array_key_exists('content', $child) ? nl2br($child['content']) : '';
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user