WIP refactor to take advantage of minisearch 6.0
This commit is contained in:
@@ -1,9 +1,9 @@
|
||||
import {
|
||||
type CachedMetadata,
|
||||
Notice,
|
||||
Platform,
|
||||
getAllTags,
|
||||
Notice,
|
||||
parseFrontMatterAliases,
|
||||
Platform,
|
||||
} from 'obsidian'
|
||||
import type { SearchMatch } from '../globals'
|
||||
import {
|
||||
@@ -207,8 +207,8 @@ export function getCtrlKeyLabel(): 'ctrl' | '⌘' {
|
||||
|
||||
export function isFileIndexable(path: string): boolean {
|
||||
return (
|
||||
(settings.PDFIndexing && path.endsWith('.pdf')) ||
|
||||
isFilePlaintext(path) ||
|
||||
(settings.PDFIndexing && isFilePDF(path)) ||
|
||||
(settings.imagesIndexing && isFileImage(path))
|
||||
)
|
||||
}
|
||||
@@ -219,6 +219,10 @@ export function isFileImage(path: string): boolean {
|
||||
)
|
||||
}
|
||||
|
||||
export function isFilePDF(path: string): boolean {
|
||||
return path.endsWith('.pdf')
|
||||
}
|
||||
|
||||
export function isFilePlaintext(path: string): boolean {
|
||||
return getPlaintextExtensions().some(t => path.endsWith(`.${t}`))
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user