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

Function sanitizeNoteTitle

apps/desktop/src/main/vault.ts:2987–2995  ·  view source on GitHub ↗
(raw: string | undefined)

Source from the content-addressed store, hash-verified

2985 * like "RFC / Design Doc" cannot escape into a nonexistent subdirectory.
2986 */
2987export function sanitizeNoteTitle(raw: string | undefined): string {
2988 return (
2989 (raw ?? '')
2990 .replace(/[\\/:\u0000-\u001f*?"<>|]/g, '-')
2991 .replace(/\s+/g, ' ')
2992 .trim()
2993 .slice(0, 200) || 'Untitled'
2994 )
2995}
2996
2997export async function createNote(
2998 root: string,

Callers 5

createRecordPageFunction · 0.90
migrateOneLegacyDatabaseFunction · 0.85
createNoteFunction · 0.85
createExcalidrawFunction · 0.85
renameNoteFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected