MCPcopy Create free account
hub / github.com/ZenNotes/zennotes / noteHasBody

Function noteHasBody

apps/desktop/src/main/databases.ts:144–150  ·  view source on GitHub ↗

True if a note has body content beyond its frontmatter + a single title heading.

(text: string)

Source from the content-addressed store, hash-verified

142
143/** True if a note has body content beyond its frontmatter + a single title heading. */
144function 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
152async function readPageContentFlags(
153 root: string,

Callers 1

readPageContentFlagsFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected