From ebc8173f79f9051fde418bb04b7786e35fe27fa9 Mon Sep 17 00:00:00 2001 From: RyotaUshio Date: Tue, 21 Nov 2023 22:28:22 +0900 Subject: [PATCH] release: 0.1.2 --- manifest.json | 2 +- package-lock.json | 4 ++-- package.json | 2 +- src/main.ts | 5 +++-- 4 files changed, 7 insertions(+), 6 deletions(-) diff --git a/manifest.json b/manifest.json index 4830b9e..84bf02b 100644 --- a/manifest.json +++ b/manifest.json @@ -1,7 +1,7 @@ { "id": "better-link-autocompletion", "name": "Better Link Autocompletion", - "version": "0.1.1", + "version": "0.1.2", "minAppVersion": "1.3.5", "description": "Enhance Obsidian's built-in link autocompletion.", "author": "Ryota Ushio", diff --git a/package-lock.json b/package-lock.json index 0515cc8..ca4a34a 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "obsidian-better-link-autocompletion", - "version": "0.1.1", + "version": "0.1.2", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "obsidian-better-link-autocompletion", - "version": "0.1.1", + "version": "0.1.2", "license": "MIT", "dependencies": { "@codemirror/language": "^6.9.1", diff --git a/package.json b/package.json index 1905e6f..fd5bb3d 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "obsidian-better-link-autocompletion", - "version": "0.1.1", + "version": "0.1.2", "description": "Enhance Obsidian's built-in link autocompletion.", "scripts": { "dev": "node esbuild.config.mjs", diff --git a/src/main.ts b/src/main.ts index 6ae7fbe..b4203db 100644 --- a/src/main.ts +++ b/src/main.ts @@ -29,7 +29,7 @@ interface BlockLinkInfo extends LinkInfo { type: "block"; idMatch: SearchMatches | null; subpath: string; - node: any; + node?: any; display: string; content: string; } @@ -62,12 +62,13 @@ export default class MyPlugin extends Plugin { patch() { // @ts-ignore const prototype = this.app.workspace.editorSuggest.suggests[0].constructor.prototype as BuiltInAutocompletion; + const plugin = this; const uninstaller = around(prototype, { renderSuggestion(old) { return function (item: Item, el: HTMLElement) { if (item.type === "block") { - if (this.settings.math && item.node.type === "math") { + if (plugin.settings.math && item.node?.type === "math") { el.appendChild(renderMath(item.node.value, true)) return; }