Skip to content
Open
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
7 changes: 6 additions & 1 deletion packages/core/src/api/exporters/markdown/markdownExporter.ts
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,12 @@ export function cleanHTMLToMarkdown(cleanHTMLString: string) {
})
.processSync(cleanHTMLString);

return markdownString.value as string;
let result = markdownString.value as string;

// Remove extra blank lines between list items
result = result.replace(/\n\n(?=\d+\.|-|\*)/g, "\n");

return result;
}

export async function blocksToMarkdown<
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,6 @@ exports[`Test ServerBlockNoteEditor > converts to and from markdown (blocksToMar
"## **Heading&#x20;***~~2~~*

Paragraph

* list item

![Example](exampleURL)
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
## **Heading&#x20;***~~2~~*

Paragraph

*
Original file line number Diff line number Diff line change
@@ -1,10 +1,6 @@
* Bullet List Item 1

* Bullet List Item 2

1. Numbered List Item 1

2. Numbered List Item 2

* [ ] Check List Item 1
* [x] Check List Item 2
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
* Bullet List Item 1

* Bullet List Item 2

1. Numbered List Item 1
Expand Down
Loading