Skip to content

Commit

Permalink
🐛 Fix missing titme when trimming
Browse files Browse the repository at this point in the history
  • Loading branch information
AnandChowdhary authored Jul 28, 2022
1 parent fdf36d1 commit e98e77e
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ const parseNoteFile = async (dirName: string, year: string, file: string): Promi
"title: ",
""
) ||
(contents.split("\n").find((line) => line.startsWith("# ")) || "").split("# ")[1].trim() ||
((contents.split("\n").find((line) => line.startsWith("# ")) || "").split("# ")[1] || "").trim() ||
undefined;
const excerpt =
(contents.split("\n").find((line) => line.startsWith("excerpt: ")) || "").replace(
Expand Down

0 comments on commit e98e77e

Please sign in to comment.