Skip to content

Commit

Permalink
fix(TagNote): 🐛 Allow non-conventional tag syntax
Browse files Browse the repository at this point in the history
  • Loading branch information
SkepticMystic committed Jan 8, 2022
1 parent b3162b0 commit 075b935
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 12 deletions.
12 changes: 6 additions & 6 deletions main.js
Original file line number Diff line number Diff line change
Expand Up @@ -51831,12 +51831,12 @@ class BCPlugin extends require$$0.Plugin {
const { tags, frontmatter } = this.app.metadataCache.getFileCache(file);
const allTags = [];
tags === null || tags === void 0 ? void 0 : tags.forEach((t) => allTags.push(dropHash(t.tag)));
[(_a = frontmatter === null || frontmatter === void 0 ? void 0 : frontmatter.tags) !== null && _a !== void 0 ? _a : []]
.flat()
.forEach((t) => allTags.push(dropHash(t)));
[(_b = frontmatter === null || frontmatter === void 0 ? void 0 : frontmatter.tag) !== null && _b !== void 0 ? _b : []]
.flat()
.forEach((t) => allTags.push(dropHash(t)));
[(_a = frontmatter === null || frontmatter === void 0 ? void 0 : frontmatter.tags) !== null && _a !== void 0 ? _a : []].flat().forEach((t) => {
splitAndTrim(t).forEach((innerT) => allTags.push(dropHash(innerT)));
});
[(_b = frontmatter === null || frontmatter === void 0 ? void 0 : frontmatter.tag) !== null && _b !== void 0 ? _b : []].flat().forEach((t) => {
splitAndTrim(t).forEach((innerT) => allTags.push(dropHash(innerT)));
});
return allTags.map((t) => (withHash ? "#" : "") + t.toLowerCase());
};
this.getTargetOrder = (frontms, target) => {
Expand Down
13 changes: 7 additions & 6 deletions src/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,7 @@ import {
getRealnImplied,
iterateHiers,
makeWiki,
splitAndTrim,
splitAtYaml,
strToRegex,
} from "./sharedFunctions";
Expand Down Expand Up @@ -1084,12 +1085,12 @@ export default class BCPlugin extends Plugin {

tags?.forEach((t) => allTags.push(dropHash(t.tag)));

[frontmatter?.tags ?? []]
.flat()
.forEach((t: string) => allTags.push(dropHash(t)));
[frontmatter?.tag ?? []]
.flat()
.forEach((t: string) => allTags.push(dropHash(t)));
[frontmatter?.tags ?? []].flat().forEach((t: string) => {
splitAndTrim(t).forEach((innerT) => allTags.push(dropHash(innerT)));
});
[frontmatter?.tag ?? []].flat().forEach((t: string) => {
splitAndTrim(t).forEach((innerT) => allTags.push(dropHash(innerT)));
});

return allTags.map((t) => (withHash ? "#" : "") + t.toLowerCase());
};
Expand Down

0 comments on commit 075b935

Please sign in to comment.