From b381cb5828fa4a2fab9f882817181db6b2527bb7 Mon Sep 17 00:00:00 2001 From: mgmeyers Date: Thu, 23 Dec 2021 10:07:38 -0800 Subject: [PATCH] Check for empty selector --- manifest.json | 2 +- src/getMatchedCSSRules.ts | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/manifest.json b/manifest.json index 93e4f66..d1ef761 100644 --- a/manifest.json +++ b/manifest.json @@ -1,7 +1,7 @@ { "id": "obsidian-embedded-note-titles", "name": "Embedded Note Titles", - "version": "1.2.1", + "version": "1.2.2", "minAppVersion": "0.13.8", "description": "Inserts the note file name as an H1 heading above each note.", "author": "mgmeyers", diff --git a/src/getMatchedCSSRules.ts b/src/getMatchedCSSRules.ts index e2e8664..1acae87 100644 --- a/src/getMatchedCSSRules.ts +++ b/src/getMatchedCSSRules.ts @@ -138,7 +138,7 @@ export function getMatchedCSSRules(element: HTMLElement): CSSStyleRule[] { } // check if this element matches this rule's selector - if (element.matches(rule.selectorText)) { + if (rule.selectorText && element.matches(rule.selectorText)) { // push the rule to the results set result.push(rule); }