mirror of
https://github.com/TriliumNext/Notes.git
synced 2025-08-01 20:52:27 +08:00
feat(template): duplicate content for mermaid diagrams
This commit is contained in:
parent
82a63a65da
commit
c7b99adb6a
@ -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;
|
||||
|
@ -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) &&
|
||||
|
Loading…
x
Reference in New Issue
Block a user