Purge HTML before indexing notes

This commit is contained in:
Simon Cambier
2022-04-12 20:46:32 +02:00
parent 8bc57c4362
commit eccb2fed71

View File

@@ -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)