diff --git a/src/public/app/services/note_create.ts b/src/public/app/services/note_create.ts index 47cf02bb6..14299ba4f 100644 --- a/src/public/app/services/note_create.ts +++ b/src/public/app/services/note_create.ts @@ -62,7 +62,7 @@ async function createNote(parentNotePath: string | undefined, options: CreateNot const parentNoteId = treeService.getNoteIdFromUrl(parentNotePath); - if (options.type === "mermaid" && !options.content) { + if (options.type === "mermaid" && !options.content && !options.templateNoteId) { options.content = `graph TD; A-->B; A-->C; diff --git a/src/services/handlers.ts b/src/services/handlers.ts index 2630e2519..5c65c8a49 100644 --- a/src/services/handlers.ts +++ b/src/services/handlers.ts @@ -102,7 +102,7 @@ eventService.subscribe(eventService.ENTITY_CREATED, ({ entityName, entity }) => const content = note.getContent(); if ( - ["text", "code"].includes(note.type) && + ["text", "code", "mermaid"].includes(note.type) && typeof content === "string" && // if the note has already content we're not going to overwrite it with template's one (!content || content.trim().length === 0) &&