(body: string)
| 43 | * chars. So a captured task `- [ ] buy milk` titles the note "buy milk" |
| 44 | * (the marker still lives in the body). */ |
| 45 | export function deriveTitle(body: string): string { |
| 46 | for (const line of body.split('\n')) { |
| 47 | const t = stripLeadingMarker(line.trim()) |
| 48 | if (t) return t.slice(0, 60) |
| 49 | } |
| 50 | return new Date().toISOString().slice(0, 19).replace(/[:T]/g, '-') |
| 51 | } |
| 52 | |
| 53 | /** Strip a leading heading (`#`), list bullet (`-`/`*`/`+`, `1.`) and/or task |
| 54 | * checkbox (`[ ]`/`[x]`) so titles derived from list/task lines read cleanly. */ |
no test coverage detected