From 48ff39ca7e54e5d87590a6df79e6fce0dd291cc2 Mon Sep 17 00:00:00 2001 From: Grzegorz Godlewski Date: Sat, 17 Feb 2024 18:14:29 +0100 Subject: [PATCH] Fix the spacing for the implicit line breaks in odt --- src/odt/postprocess/mergeParagraphs.ts | 4 ++-- test/odt_md/Issues.test.ts | 1 - test/odt_md/issue-434.md | 2 +- 3 files changed, 3 insertions(+), 4 deletions(-) diff --git a/src/odt/postprocess/mergeParagraphs.ts b/src/odt/postprocess/mergeParagraphs.ts index 001a4e7f..29847b0c 100644 --- a/src/odt/postprocess/mergeParagraphs.ts +++ b/src/odt/postprocess/mergeParagraphs.ts @@ -67,7 +67,7 @@ export function mergeParagraphs(markdownChunks: MarkdownChunks, rewriteRules: Re const findFirstTextAfterPos = (start: number): string | null => { for (let pos = start + 1; pos < markdownChunks.chunks.length; pos++) { const currentChunk = markdownChunks.chunks[pos]; - if ('text' in currentChunk) { + if ('text' in currentChunk && currentChunk.text !== '') { return currentChunk.text; } } @@ -80,7 +80,7 @@ export function mergeParagraphs(markdownChunks: MarkdownChunks, rewriteRules: Re isTag: false, text: '\n', mode: 'md', - comment: 'End of line, but next line is list' + comment: 'End of line, but next line is list' + nextText + ' ' + nextParaClosing }); position--; previousParaPosition = 0; diff --git a/test/odt_md/Issues.test.ts b/test/odt_md/Issues.test.ts index 089fd6f3..7a59ed9f 100644 --- a/test/odt_md/Issues.test.ts +++ b/test/odt_md/Issues.test.ts @@ -31,7 +31,6 @@ describe('MarkDownTransformTest', () => { }); it('test ./issue-434', async () => { - return; // Should we convert this fake list into real? // https://github.com/mieweb/wikiGDrive/issues/434 const testMarkdown = fs.readFileSync(__dirname + '/issue-434.md').toString(); const markdown = await transformOdt('issue-434'); diff --git a/test/odt_md/issue-434.md b/test/odt_md/issue-434.md index 4bfbf229..6a87a80b 100644 --- a/test/odt_md/issue-434.md +++ b/test/odt_md/issue-434.md @@ -8,4 +8,4 @@ **LOINC Code:** Logical Observation Identifiers Names and Codes (LOINC) are used primarily for results coming into the system, to match "apples to apples". Enterprise Health's Medical Codify may be used to search for or reference LOINC codes, as well as other online resources. **Layout:** Some orders have specific Exam Order Layouts assigned to them so they display consistently when results are manually entered, typically in the Tests and procedures section of an encounter. **Doc Type:** A specific document type can be assigned to an order code within this editor, so that when these orders are resulted, a separate document is created. -**Appt. Type:** An appointment type can be tied to order codes within this editor so that when an order is on the due list and needs scheduled for an appointment, the system automatically selects the correct appointment type, with the proper amount of time allocated. +**Appt. Type:** An appointment type can be tied to order codes within this editor so that when an order is on the due list and needs scheduled for an appointment, the system automatically selects the correct appointment type, with the proper amount of time allocated.