From 140a67c57442510352eb1ded5ee7db89a35eb492 Mon Sep 17 00:00:00 2001 From: ken Date: Mon, 25 Nov 2024 01:09:21 +0800 Subject: [PATCH] apply filter to tag query --- src/util/CodeBlockProcessor.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/util/CodeBlockProcessor.ts b/src/util/CodeBlockProcessor.ts index 465a3cc..134502e 100644 --- a/src/util/CodeBlockProcessor.ts +++ b/src/util/CodeBlockProcessor.ts @@ -48,7 +48,7 @@ export class codeBlockProcessor { //const tag = source.replace(/frontmatter_tag:/, '').trim(); const tag = query.value; - const files = this.plugin.app.vault.getMarkdownFiles(); + const files = this.plugin.app.vault.getMarkdownFiles().filter(f=>this.plugin.view.testPathFilter(f.path)); const matchingFiles = await Promise.all(files.map(async (file) => { const cache = this.plugin.app.metadataCache.getCache(file.path); @@ -80,7 +80,7 @@ ${result.map(v => "- [[" + v.replace(/.md$/, "") + "]]").join("\n")} } private async tagProcessor(query: queryKey): Promise[]>{ const term = query.value; - const files = this.plugin.app.vault.getMarkdownFiles(); + const files = this.plugin.app.vault.getMarkdownFiles().filter(f=>this.plugin.view.testPathFilter(f.path)); const arr = files.map( async (file) => { const content = await this.plugin.app.vault.cachedRead(file); @@ -175,7 +175,7 @@ ${result.map(v => "- [[" + v.replace(/.md$/, "") + "]]").join("\n")} private async timeDurationProcessor(query: queryKey): Promise[]> { const queryDuration = Number(query.value.replace('#','').replace('day','')); - const files = this.plugin.app.vault.getMarkdownFiles(); + const files = this.plugin.app.vault.getMarkdownFiles().filter(f=>this.plugin.view.testPathFilter(f.path)); const arr = files.map( async (file) => { const content = await this.plugin.app.vault.cachedRead(file);