diff --git a/src/lib/components/NoteCard.svelte b/src/lib/components/NoteCard.svelte index db4b19b..809bafd 100644 --- a/src/lib/components/NoteCard.svelte +++ b/src/lib/components/NoteCard.svelte @@ -16,6 +16,7 @@ interface ChecklistItem { text: string; checked: boolean; + indented: boolean; } interface Props { @@ -38,10 +39,14 @@ const checklistItems = $derived( note.checklistMode - ? note.content.split('\n').filter(l => l.trim()).map(line => ({ - text: line.replace(/^- \[[ x]\] /, ''), - checked: line.startsWith('- [x] ') - })) + ? note.content.split('\n').filter(l => l.trim()).map(line => { + const indented = line.startsWith(' - ['); + return { + text: line.replace(/^ {0,2}- \[[ x]\] /, ''), + checked: line.includes('[x]'), + indented + }; + }) : [] ); @@ -127,7 +132,8 @@ {#if note.checklistMode && checklistItems.length > 0}