From 6e845a9197f78632f64e2d3459cc7f601eec37ab Mon Sep 17 00:00:00 2001 From: Heniker Date: Sun, 20 Jun 2021 20:22:26 +0300 Subject: [PATCH] accept normal tags --- src/ui/sources/tags.ts | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/ui/sources/tags.ts b/src/ui/sources/tags.ts index 5c768c7..adfcb5d 100644 --- a/src/ui/sources/tags.ts +++ b/src/ui/sources/tags.ts @@ -13,12 +13,14 @@ function getNoteTags(note: TFile | null): string[] { return []; } - const { metadataCache } = window.app; - const frontmatter = metadataCache.getFileCache(note)?.frontmatter; + const fileCache = window.app.metadataCache.getFileCache(note); + const frontmatter = fileCache?.frontmatter; - const tags = []; + // get normal tags + const tags = fileCache?.tags?.map((it) => it.tag) || []; if (frontmatter) { + // get metadata tags const frontmatterTags = parseFrontMatterTags(frontmatter) || []; tags.push(...frontmatterTags); }