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

Function stripLeadingMarker

apps/desktop/src/cli/commands/capture.ts:55–61  ·  view source on GitHub ↗

Strip a leading heading (`#`), list bullet (`-`/`*`/`+`, `1.`) and/or task * checkbox (`[ ]`/`[x]`) so titles derived from list/task lines read cleanly.

(line: string)

Source from the content-addressed store, hash-verified

53/** Strip a leading heading (`#`), list bullet (`-`/`*`/`+`, `1.`) and/or task
54 * checkbox (`[ ]`/`[x]`) so titles derived from list/task lines read cleanly. */
55function stripLeadingMarker(line: string): string {
56 return line
57 .replace(/^#+\s*/, '')
58 .replace(/^(?:[-*+]|\d+[.)])\s+/, '')
59 .replace(/^\[[ xX]\]\s*/, '')
60 .trim()
61}
62
63function composeBody(title: string, body: string, tags: string[]): string {
64 const heading = `# ${title}\n\n`

Callers 1

deriveTitleFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected