Skip to content

Commit

Permalink
fix: Fixes inspecting tags for span events
Browse files Browse the repository at this point in the history
  • Loading branch information
valentine195 committed Feb 20, 2024
1 parent 220b05e commit d5a600f
Showing 1 changed file with 5 additions and 8 deletions.
13 changes: 5 additions & 8 deletions src/watcher/watcher.worker.ts
Original file line number Diff line number Diff line change
@@ -1,10 +1,5 @@
import type { CachedMetadata, FrontMatterCache } from "obsidian";
import type {
Calendar,
CalEvent,
CalEventCategory,
Nullable,
} from "src/@types";
import type { Calendar, CalEvent, CalEventCategory } from "src/@types";
import { CalEventHelper } from "src/events/event.helper";
import type {
OptionsMessage,
Expand All @@ -21,7 +16,9 @@ import type {
const ctx: Worker = self as any;

function resolveTags(inlineTags: (string | null)[], allTags: string[]) {
return inlineTags.some((tag) => tag && allTags.includes(tag));
return inlineTags.some(
(tag) => tag && (allTags.includes(tag) || allTags.includes(`#${tag}`))
);
}
class Parser {
queue: string[] = [];
Expand Down Expand Up @@ -250,7 +247,7 @@ class Parser {
createEventHandler(
frontmatter: FrontMatterCache | undefined,
file: { path: string; basename: string }
): Nullable<CalEventHelper> {
): CalEventHelper | null {
if (!frontmatter?.["fc-ignore"]) {
let name = frontmatter?.["fc-calendar"];
if (!name || !name.length) {
Expand Down

0 comments on commit d5a600f

Please sign in to comment.