Build your personal knowledge base with Trilium Notes
TypeScript electronelectron-appknowledge-baseknowledge-graphknowledge-managementknowledge-management-graphlocal-firstnote-managmentnote-takernote-takingnotebooknotesnotes-apppersonal-knowledge-basepersonal-wikiscriptableself-hostedself-hostingwiki
feat(todo): find the to-do list by task, checklist and checkbox
Elian Doran8857987811df
diff --git a/packages/ckeditor5/src/plugins/mention/slash_commands.spec.ts b/packages/ckeditor5/src/plugins/mention/slash_commands.spec.tsindex 609854551c..35c131398b 100644--- a/packages/ckeditor5/src/plugins/mention/slash_commands.spec.ts+++ b/packages/ckeditor5/src/plugins/mention/slash_commands.spec.ts@@ -659,9 +659,15 @@ describe("buildTriliumSlashCommands", () => {expect(executeSpy).toHaveBeenCalledWith("alignment", { value });});- it("finds the to-do list by the word todo", () => {- expect(matchSlashCommands(buildTriliumSlashCommands(editor), "todo").map((entry) => entry.id))- .toContain("todoList");+ it("finds the to-do list under the names other editors give it", () => {+ const definitions = buildTriliumSlashCommands(editor);++ // None of these reach the title: the hyphen in "To-do list" keeps "todo" from matching it+ // as a prefix or a substring, and the rest are words the title never uses.+ for (const query of [ "todo", "task", "checklist", "checkbox" ]) {+ expect(matchSlashCommands(definitions, query).map((entry) => entry.id))+ .toContain("todoList");+ }});it("finds the collapsible block under the names other editors give it", () => {diff --git a/packages/ckeditor5/src/plugins/mention/slash_commands.ts b/packages/ckeditor5/src/plugins/mention/slash_commands.tsindex 6677befdfd..82742a1ad8 100644--- a/packages/ckeditor5/src/plugins/mention/slash_commands.ts+++ b/packages/ckeditor5/src/plugins/mention/slash_commands.ts@@ -476,7 +476,7 @@ function buildListSlashCommands(editor: Editor): SlashCommandDefinition[] {id: "todoList",title: t("To-do list"),description: t("Create a to-do list"),- aliases: [ "todo" ],+ aliases: [ "todo", "task", "checklist", "checkbox" ],icon: IconTodoList,commandName: "todoList"}