From 9bdb05fb9e6176d1298e3e5637d7f15964c3649a Mon Sep 17 00:00:00 2001 From: Anand Chowdhary Date: Thu, 7 Jul 2022 23:01:15 +0200 Subject: [PATCH] :bug: Ignore front matter data in files --- src/index.ts | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/index.ts b/src/index.ts index 4dd2349..99374db 100644 --- a/src/index.ts +++ b/src/index.ts @@ -47,7 +47,10 @@ const parseNoteFile = async (dirName: string, year: string, file: string): Promi "" ) || (title - ? (contents.split(title)[1] || "") + ? ((contents.split(title)[1] || "").includes("---\n") + ? (contents.split(title)[1] || "").split("---\n").pop() || "" + : contents.split(title)[1] || "" + ) .trim() .split("\n") .find((line) => line.length > 10) || undefined