True if a note has body content beyond its frontmatter + a single title heading.
(text: string)
| 142 | |
| 143 | /** True if a note has body content beyond its frontmatter + a single title heading. */ |
| 144 | function noteHasBody(text: string): boolean { |
| 145 | let body = text |
| 146 | const fm = /^---\r?\n[\s\S]*?\r?\n---\r?\n?/.exec(body) |
| 147 | if (fm) body = body.slice(fm[0].length) |
| 148 | body = body.replace(/^\s*#[^\n]*\r?\n?/, '') // drop a single leading heading |
| 149 | return body.trim().length > 0 |
| 150 | } |
| 151 | |
| 152 | async function readPageContentFlags( |
| 153 | root: string, |
no outgoing calls
no test coverage detected