From fe64b8a96f13e66dbb6b70a9c4970c7161ec0bd2 Mon Sep 17 00:00:00 2001 From: PJ Date: Wed, 29 Mar 2023 22:00:06 -0400 Subject: [PATCH] Fix for tag pane HTML changes in Obsidian 1.2 beta --- manifest.json | 2 +- src/plugin.js | 6 +++--- versions.json | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/manifest.json b/manifest.json index a582536..ef4c93c 100644 --- a/manifest.json +++ b/manifest.json @@ -3,7 +3,7 @@ "name": "Tag Wrangler", "author": "PJ Eby", "authorUrl": "https://github.com/pjeby", - "version": "0.5.7", + "version": "0.5.8", "minAppVersion": "0.15.9", "description": "Rename, merge, toggle, and search tags from the tag pane", "isDesktopOnly": false diff --git a/src/plugin.js b/src/plugin.js index 9df3f8e..af80166 100644 --- a/src/plugin.js +++ b/src/plugin.js @@ -49,7 +49,7 @@ export default class TagWrangler extends Plugin { // Tags in the tag pane new TagPageUIHandler(this, { hoverSource: tagHoverMain, selector: ".tag-pane-tag", container: ".tag-container", - toTag(el) { return el.find(".tag-pane-tag-text")?.textContent; } + toTag(el) { return el.find(".tag-pane-tag-text, tag-pane-tag-text, .tag-pane-tag .tree-item-inner-text")?.textContent; } }) ); @@ -90,7 +90,7 @@ export default class TagWrangler extends Plugin { ); this.register( onElement(document, "dragstart", ".tag-pane-tag", (event, targetEl) => { - const tagName = targetEl.find(".tag-pane-tag-text")?.textContent; + const tagName = targetEl.find(".tag-pane-tag-text, tag-pane-tag-text, .tag-pane-tag .tree-item-inner-text")?.textContent; event.dataTransfer.setData("text/plain", "#"+tagName); app.dragManager.onDragStart(event, { source: "tag-wrangler", @@ -167,7 +167,7 @@ export default class TagWrangler extends Plugin { } const - tagName = tagEl.find(".tag-pane-tag-text").textContent, + tagName = tagEl.find(".tag-pane-tag-text, .tag-pane-tag .tree-item-inner-text").textContent, tagPage = this.tagPage(tagName), isHierarchy = tagEl.parentElement.parentElement.find(".collapse-icon"), searchPlugin = this.app.internalPlugins.getPluginById("global-search"), diff --git a/versions.json b/versions.json index 10485df..f919347 100644 --- a/versions.json +++ b/versions.json @@ -1,5 +1,5 @@ { - "0.5.7": "0.15.9", + "0.5.8": "0.15.9", "0.5.5": "0.15.9", "0.5.3": "0.14.5", "0.5.2": "0.13.19",