Skip to content

Commit

Permalink
🐛 Ignore front matter data in files
Browse files Browse the repository at this point in the history
  • Loading branch information
AnandChowdhary committed Jul 7, 2022
1 parent fbc0973 commit 9bdb05f
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 9bdb05f

Please sign in to comment.