-
Notifications
You must be signed in to change notification settings - Fork 4
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[功能请求]优化标签搜索「tags是占位符的模板」不能正常使用的问题。 #66
Comments
我在原有的基础上修改一行代码,可以成功搜索。 tagArray = Array.isArray(tags) ? tags : (typeof tags === 'string' ? tags.split(",").filter((p) => p).map((p) => p.trim()) : []); function getFileTagArray(file) {
var _a, _b, _c, _d;
let tags = ((_b = (_a = app.metadataCache.getFileCache(file)) == null ? void 0 : _a.frontmatter) == null ? void 0 : _b.tags) || ((_d = (_c = app.metadataCache.getFileCache(file)) == null ? void 0 : _c.frontmatter) == null ? void 0 : _d.tag), tagArray;
if (tags)
tagArray = Array.isArray(tags) ? tags : (typeof tags === 'string' ? tags.split(",").filter((p) => p).map((p) => p.trim()) : []);
return tagArray;
} |
顺带一提,有点不清楚getFileTagArray函数里面下面这行代码tags、tagArray的关系。
是BUG吗?
提到这个,是因为我得到的搜索结果是「关键词和标签的并集」,而不是我想要的「关键词和标签的交集」,我刚开始使用这插件,不确定是不是正确的逻辑。 |
哦,关于交并集的部分确实写错了,都在 2.27.7 版里改了 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
这个问题应该比较容易解决,希望早点修复。最简单的方式,只处理数组、字符串类型的tags。
复现方式
新建一个模板 tags字段是{{}}的模板。

使用标签搜索任意标签。

日志
The text was updated successfully, but these errors were encountered: