Small (potential) bugfixes

This commit is contained in:
Simon Cambier
2022-12-31 21:26:15 +01:00
parent d810959150
commit c8bdcad17c
4 changed files with 9 additions and 8 deletions

View File

@@ -31,6 +31,8 @@
searching = true
updateResults().then(() => {
searching = false
}).catch((e) => {
console.error(e)
})
} else {
searching = false

View File

@@ -87,13 +87,7 @@ export function getChsSegmenter(): any | undefined {
}
export type TextExtractorApi = {
extractText: (
file: TFile,
ocrOptions?: {
langs: string[]
}
) => Promise<string>
getOcrLangs: () => string[]
extractText: (file: TFile) => Promise<string>
canFileBeExtracted: (filePath: string) => boolean
}

View File

@@ -46,7 +46,9 @@ export default class OmnisearchPlugin extends Plugin {
id: 'show-modal-infile',
name: 'In-file search',
editorCallback: (_editor, view) => {
if (view.file) {
new OmnisearchInFileModal(app, view.file).open()
}
},
})

View File

@@ -202,6 +202,9 @@ export function getTagsFromMetadata(metadata: CachedMetadata | null): string[] {
* https://stackoverflow.com/a/37511463
*/
export function removeDiacritics(str: string): string {
if (str === null || str === undefined) {
return ''
}
return str.normalize('NFD').replace(/\p{Diacritic}/gu, '')
}