Purge HTML before indexing notes
This commit is contained in:
@@ -93,10 +93,14 @@ export default class OmnisearchPlugin extends Plugin {
|
|||||||
// trim the markdown, remove embeds and clear wikilinks
|
// trim the markdown, remove embeds and clear wikilinks
|
||||||
const content = clearContent(await this.app.vault.cachedRead(file))
|
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
|
// Make the document and index it
|
||||||
const note: IndexedNote = {
|
const note: IndexedNote = {
|
||||||
basename: file.basename,
|
basename: file.basename,
|
||||||
content,
|
content: tmp.innerText,
|
||||||
path: file.path,
|
path: file.path,
|
||||||
}
|
}
|
||||||
this.minisearch.add(note)
|
this.minisearch.add(note)
|
||||||
|
|||||||
Reference in New Issue
Block a user