Skip to content

Commit

Permalink
🐛 Fix fallback heading parsing
Browse files Browse the repository at this point in the history
  • Loading branch information
AnandChowdhary committed Nov 22, 2022
1 parent cf35d22 commit 99cf5d5
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 @@ -50,7 +50,7 @@ const parseNoteFile = async (dirName: string, year: string, file: string): Promi
const title = (
"title" in attributes && typeof attributes.title === "string"
? attributes.title
: body.match(/^# (.*)/m)?.[2]
: body.match(/^# (.*)/m)?.[1]
)?.trim();
if (!title) throw new Error(`Unable to parse title in ${path}`);

Expand Down

0 comments on commit 99cf5d5

Please sign in to comment.