Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Develop #442

Merged
merged 2 commits into from
Feb 17, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions src/odt/postprocess/mergeParagraphs.ts
Original file line number Diff line number Diff line change
Expand Up @@ -67,14 +67,14 @@ 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.trim() !== '') {
return currentChunk.text;
}
}
return null;
};

const nextText = findFirstTextAfterPos(nextParaClosing);
const nextText = findFirstTextAfterPos(position);
if (nextText === '* ' || nextText?.trim().length === 0) {
markdownChunks.chunks.splice(position, 2, {
isTag: false,
Expand Down
8 changes: 7 additions & 1 deletion test/odt_md/Issues.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,13 +31,19 @@ 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');
assert.ok(compareTexts(testMarkdown, markdown, false));
});

it('test ./issue-434-2', async () => {
// https://github.com/mieweb/wikiGDrive/issues/434
const testMarkdown = fs.readFileSync(__dirname + '/issue-434-2.md').toString();
const markdown = await transformOdt('issue-434-2');
assert.ok(compareTexts(testMarkdown, markdown, false));
});

it('test ./issue-435-436', async () => {
// https://github.com/mieweb/wikiGDrive/issues/435
// https://github.com/mieweb/wikiGDrive/issues/436
Expand Down
2 changes: 1 addition & 1 deletion test/odt_md/example-document.md
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ After subtable</td>

### Heading 3 - a diagram with links

[Diagram](gdoc:1Du-DYDST4liLykJl0fHSCvuQYIYhtOfwco-ntn38Dy8)
[Diagram](gdoc:1Du-DYDST4liLykJl0fHSCvuQYIYhtOfwco-ntn38Dy8)
[Diagram](gdoc:1Du-DYDST4liLykJl0fHSCvuQYIYhtOfwco-ntn38Dy8)

### Heading 3 - with a Table of contents
Expand Down
15 changes: 15 additions & 0 deletions test/odt_md/issue-434-2.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
**This** is a line
**This** is line two


* This is a bulleted test
* Second line



hi

This is a cool new wikiGDrive! With a change.

![](1000000000000801000006000FC688CE4398B42C.jpg)![](100000000000080100000600C22E7BC1728488D6.jpg)![](10000000000009C4000007537CA7AEBC30C18882.jpg)![](10000000000009C400000753E2645860B6CEB342.jpg)
Binary file added test/odt_md/issue-434-2.odt
Binary file not shown.
2 changes: 1 addition & 1 deletion test/odt_md/issue-434.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Loading