True if a note has body beyond frontmatter + a single title heading.
(text: string)
| 654 | |
| 655 | /** True if a note has body beyond frontmatter + a single title heading. */ |
| 656 | function dbNoteHasBody(text: string): boolean { |
| 657 | let body = text |
| 658 | const fm = /^---\r?\n[\s\S]*?\r?\n---\r?\n?/.exec(body) |
| 659 | if (fm) body = body.slice(fm[0].length) |
| 660 | body = body.replace(/^\s*#[^\n]*\r?\n?/, '') |
| 661 | return body.trim().length > 0 |
| 662 | } |
| 663 | |
| 664 | /** Defensive sidecar parse — mirror of databases.ts normalizeSidecar. */ |
| 665 | function dbNormalizeSidecar(raw: unknown): DatabaseSidecar | null { |