Skip to content

Build your personal knowledge base with Trilium Notes

fix js note can't run

Jin69586e6876db
diff --git a/src/services/notes.ts b/src/services/notes.ts
index a797bce087..59031b8d99 100644
--- a/src/services/notes.ts
+++ b/src/services/notes.ts
@@ -107,7 +107,7 @@ function getNewNoteTitle(parentNote: BNote) {
// - now
// - parentNote
- title = (0, eval)(`\`${titleTemplate}\``);
+ title = eval(`\`${titleTemplate}\``);
} catch (e: any) {
log.error(`Title template of note '${parentNote.noteId}' failed with: ${e.message}`);
}
diff --git a/src/services/script.ts b/src/services/script.ts
index d814e89055..5b4004bb5d 100644
--- a/src/services/script.ts
+++ b/src/services/script.ts
@@ -99,7 +99,7 @@ function executeScript(script: string, params: ScriptParams, startNoteId: string
}
function execute(ctx: ScriptContext, script: string) {
- return function () { return (0, eval)(`const apiContext = this;\r\n(${script}\r\n)()`); }.call(ctx);
+ return function () { return eval(`const apiContext = this;\r\n(${script}\r\n)()`); }.call(ctx);
}
function getParams(params?: ScriptParams) {