From eccb2fed7155508120f1dce551e5e22629c49ec3 Mon Sep 17 00:00:00 2001 From: Simon Cambier Date: Tue, 12 Apr 2022 20:46:32 +0200 Subject: [PATCH] Purge HTML before indexing notes --- src/main.ts | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/main.ts b/src/main.ts index 95ef887..4179747 100644 --- a/src/main.ts +++ b/src/main.ts @@ -93,10 +93,14 @@ export default class OmnisearchPlugin extends Plugin { // trim the markdown, remove embeds and clear wikilinks const content = clearContent(await this.app.vault.cachedRead(file)) + // Purge HTML before indexing + const tmp = document.createElement('div') + tmp.innerHTML = content + // Make the document and index it const note: IndexedNote = { basename: file.basename, - content, + content: tmp.innerText, path: file.path, } this.minisearch.add(note)