Skip to content

Commit

Permalink
fix: Make finding correct title work on Windows with CRLF
Browse files Browse the repository at this point in the history
  • Loading branch information
nioe committed Jul 5, 2024
1 parent cb1dade commit 01e356c
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/commands/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,6 @@ const getLinks: (madrDirectory: string) => Array<string> = (madrDirectory) =>
const getTitleText: (madrFile: string) => string = (madrFile) =>
(
readFileSync(madrFile, {encoding: 'utf-8'})
.split('\n')
.split(/\r?\n/)
.find((line) => /^# .*$/.test(line)) || ''
).substring(2);

0 comments on commit 01e356c

Please sign in to comment.