From c53376a71ac068bf0e6934491691f55a4e6af5d6 Mon Sep 17 00:00:00 2001 From: windingwind <33902321+windingwind@users.noreply.github.com> Date: Mon, 14 Aug 2023 18:39:56 +0800 Subject: [PATCH] fix: markdown parse yaml header bug --- src/modules/sync/api.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/modules/sync/api.ts b/src/modules/sync/api.ts index 4292910..0b4f446 100644 --- a/src/modules/sync/api.ts +++ b/src/modules/sync/api.ts @@ -125,7 +125,8 @@ function getSyncStatus(noteId?: number): SyncStatus { } function getMDStatusFromContent(contentRaw: string): MDStatus { - const result = contentRaw.match(/^---([\s\S]*)---\n/); + contentRaw = contentRaw.replace(/\r\n/g, "\n"); + const result = contentRaw.match(/^---\n(.*\n)+?---$/gm); const ret: MDStatus = { meta: { version: -1 }, content: contentRaw,