Skip to content

Commit

Permalink
fix(dataview): disable dataview is plugin not enabled
Browse files Browse the repository at this point in the history
  • Loading branch information
Mara-Li committed Dec 29, 2023
1 parent f3faa42 commit bfd7360
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/conversion/compiler/dataview.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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";

Expand Down Expand Up @@ -37,6 +37,7 @@ export async function convertDataviewQueries(
): Promise<string> {
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);
Expand Down

0 comments on commit bfd7360

Please sign in to comment.