1
0

Remove hashtag from index tag name, related to #322

This commit is contained in:
Zef Hemel 2023-01-21 14:06:37 +01:00
parent f79bcf232b
commit a7a5ed8f0a

View File

@ -1,5 +1,5 @@
import { collectNodesOfType } from "$sb/lib/tree.ts"; import { collectNodesOfType } from "$sb/lib/tree.ts";
import { editor, index } from "$sb/silverbullet-syscall/mod.ts"; import { index } from "$sb/silverbullet-syscall/mod.ts";
import type { import type {
CompleteEvent, CompleteEvent,
IndexTreeEvent, IndexTreeEvent,
@ -14,7 +14,7 @@ export async function indexTags({ name, tree }: IndexTreeEvent) {
removeQueries(tree); removeQueries(tree);
const allTags = new Set<string>(); const allTags = new Set<string>();
collectNodesOfType(tree, "Hashtag").forEach((n) => { collectNodesOfType(tree, "Hashtag").forEach((n) => {
allTags.add(n.children![0].text!); allTags.add(n.children![0].text!.substring(1));
}); });
await index.batchSet( await index.batchSet(
name, name,