Skip to content

Commit c67a365

Browse files
committed
fix: ensure full Markdown pastes correctly
1 parent 8a8c5c5 commit c67a365

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

packages/core/src/editor/BlockNoteEditor.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1869,6 +1869,9 @@ export class BlockNoteEditor<
18691869
* @param markdown The markdown to paste.
18701870
*/
18711871
public async pasteMarkdown(markdown: string) {
1872-
return this.pasteHTML(await markdownToHTML(markdown));
1872+
const html = await markdownToHTML(markdown);
1873+
const blocks = await this.tryParseHTMLToBlocks(html);
1874+
const htmlContent = await this.blocksToHTMLLossy(blocks);
1875+
return this.pasteHTML(htmlContent);
18731876
}
18741877
}

0 commit comments

Comments
 (0)