From 763fbb58861e4e775362895e9058c2a29e02b2f8 Mon Sep 17 00:00:00 2001 From: Simon Cambier Date: Fri, 5 Jan 2024 21:26:44 +0100 Subject: [PATCH] #334 - Added a user-hidden setting to index excalidraw files --- src/cache-manager.ts | 2 +- src/settings.ts | 3 +++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/src/cache-manager.ts b/src/cache-manager.ts index 9a96fbc..26c22f7 100644 --- a/src/cache-manager.ts +++ b/src/cache-manager.ts @@ -131,7 +131,7 @@ async function getAndMapIndexedDocument( // EXCALIDRAW // Remove the json code - if (metadata.frontmatter?.['excalidraw-plugin']) { + if (settings.excalidrawIndexing && metadata.frontmatter?.['excalidraw-plugin']) { const comments = metadata.sections?.filter(s => s.type === 'comment') ?? [] for (const { start, end } of comments.map(c => c.position)) { diff --git a/src/settings.ts b/src/settings.ts index 1d3946c..8116504 100644 --- a/src/settings.ts +++ b/src/settings.ts @@ -37,6 +37,8 @@ export interface OmnisearchSettings extends WeightingSettings { PDFIndexing: boolean /** Enable Images indexing */ imagesIndexing: boolean + /** Enable Excalidraw indexing */ + excalidrawIndexing: boolean /** Enable indexing of unknown files */ unsupportedFilesIndexing: 'yes' | 'no' | 'default' /** Activate the small 🔍 button on Obsidian's ribbon */ @@ -603,6 +605,7 @@ export const DEFAULT_SETTINGS: OmnisearchSettings = { indexedFileTypes: [] as string[], PDFIndexing: false, imagesIndexing: false, + excalidrawIndexing: true, unsupportedFilesIndexing: 'no', splitCamelCase: false, openInNewPane: false,