From 9244ab3c56b4fac0e500bd9f864fe5047efd02e1 Mon Sep 17 00:00:00 2001
From: Petyo Ivanov <underlog@gmail.com>
Date: Tue, 6 Feb 2024 15:08:22 +0200
Subject: [PATCH] fix: correct line ending for markdown

---
 src/exportMarkdownFromLexical.ts | 10 ++++++----
 1 file changed, 6 insertions(+), 4 deletions(-)

diff --git a/src/exportMarkdownFromLexical.ts b/src/exportMarkdownFromLexical.ts
index 72748688..d152d2ee 100644
--- a/src/exportMarkdownFromLexical.ts
+++ b/src/exportMarkdownFromLexical.ts
@@ -392,8 +392,10 @@ export function exportMarkdownFromLexical({
   jsxComponentDescriptors,
   jsxIsAvailable
 }: ExportMarkdownFromLexicalOptions): string {
-  return toMarkdown(exportLexicalTreeToMdast({ root, visitors, jsxComponentDescriptors, jsxIsAvailable }), {
-    extensions: toMarkdownExtensions,
-    ...toMarkdownOptions
-  })
+  return (
+    toMarkdown(exportLexicalTreeToMdast({ root, visitors, jsxComponentDescriptors, jsxIsAvailable }), {
+      extensions: toMarkdownExtensions,
+      ...toMarkdownOptions
+    }) + '\n'
+  )
 }