fix: markdown parse yaml header bug

This commit is contained in:
windingwind 2023-08-14 18:39:56 +08:00
parent e57286de21
commit c53376a71a

View File

@ -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,