From 7a627c2f35b5f4d2e25e92173b3228a90abbe30a Mon Sep 17 00:00:00 2001 From: Zef Hemel Date: Sun, 20 Nov 2022 10:24:24 +0100 Subject: [PATCH] Fixes #124 --- plugs/core/item.ts | 3 ++- plugs/tasks/task.ts | 3 ++- website/CHANGELOG.md | 3 ++- 3 files changed, 6 insertions(+), 3 deletions(-) diff --git a/plugs/core/item.ts b/plugs/core/item.ts index c0492cf2..8352196e 100644 --- a/plugs/core/item.ts +++ b/plugs/core/item.ts @@ -51,7 +51,8 @@ export async function indexItems({ name, tree }: IndexTreeEvent) { if (!item.tags) { item.tags = []; } - item.tags.push(h.children![0].text!); + // Push tag to the list, removinn the initial # + item.tags.push(h.children![0].text!.substring(1)); }); items.push({ diff --git a/plugs/tasks/task.ts b/plugs/tasks/task.ts index c1d55ab6..869eac48 100644 --- a/plugs/tasks/task.ts +++ b/plugs/tasks/task.ts @@ -60,7 +60,8 @@ export async function indexTasks({ name, tree }: IndexTreeEvent) { if (!task.tags) { task.tags = []; } - task.tags.push(tree.children![0].text!); + // Push the tag to the list, removing the initial # + task.tags.push(tree.children![0].text!.substring(1)); // Remove this node from the tree return null; } diff --git a/website/CHANGELOG.md b/website/CHANGELOG.md index fea183f3..3091226e 100644 --- a/website/CHANGELOG.md +++ b/website/CHANGELOG.md @@ -7,10 +7,11 @@ release. * The editor is now in "live preview" mode where a lot of markdown is hidden unless the cursor is present. This will take some getting used to, but results in a much more distraction free look. * Clicking on the page name in the top bar now allows you to quickly rename pages, hit enter to apply the change. * The previous behavior of opening the page switcher, has now moved to its own action button (the folder one) +* Page reference completion now orders results by last modified date (newer matches appear closer to the top) * Changes to some slash commands: * `/task` now is smarter and attempts to turn your current line into a task * `/h1` through `/h4` will turn the current line into a header - +* **Breaking change:** task and item tags are [now indexed without the prefixing `#`](https://github.com/silverbulletmd/silverbullet/issues/124), this means that any queries, such as `#query task where tags = "#mytag"` need to be rewritten to `#query task where tags = "mytag"`. This will go into effect after a space reindex. --- ## 0.1.5