From bfd73607387747e440845df3f2e93f12e0310788 Mon Sep 17 00:00:00 2001 From: Mara-Li Date: Fri, 29 Dec 2023 06:11:07 +0100 Subject: [PATCH] fix(dataview): disable dataview is plugin not enabled --- src/conversion/compiler/dataview.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/conversion/compiler/dataview.ts b/src/conversion/compiler/dataview.ts index 55e2a4bb..c3b14bf5 100644 --- a/src/conversion/compiler/dataview.ts +++ b/src/conversion/compiler/dataview.ts @@ -5,7 +5,7 @@ import i18next from "i18next"; import { App, Component, FrontMatterCache, htmlToMarkdown,TFile, Vault } from "obsidian"; -import { getAPI, Literal, Success } from "obsidian-dataview"; +import { getAPI, isPluginEnabled,Literal, Success } from "obsidian-dataview"; import { FrontmatterConvert, GitHubPublisherSettings, LinkedNotes, MultiProperties } from "src/settings/interface"; import { logs, notif } from "src/utils"; @@ -37,6 +37,7 @@ export async function convertDataviewQueries( ): Promise { let replacedText = text; const dataViewRegex = /```dataview\s(.+?)```/gsm; + if (!isPluginEnabled(app)) return replacedText; const dvApi = getAPI(); if (!dvApi) return replacedText; const matches = text.matchAll(dataViewRegex);