Skip to content

Commit

Permalink
fix: improvement title parser
Browse files Browse the repository at this point in the history
  • Loading branch information
cecilia-sanare committed Feb 19, 2024
1 parent 4d4981d commit 6241ff1
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions src/lib/notes.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,7 @@ export function useTitle({ text }: Notes.List): string {
const [rawHeader] = text.split('\n');

if (rawHeader) {
const [_, match] = rawHeader.match(/([\d\w\s]+)/) ?? [];

return match?.trim();
return rawHeader.replace(/[#*_]/g, '').trim();
}

return 'Unnamed Note';
Expand Down

0 comments on commit 6241ff1

Please sign in to comment.