Small (potential) bugfixes
This commit is contained in:
@@ -31,6 +31,8 @@
|
|||||||
searching = true
|
searching = true
|
||||||
updateResults().then(() => {
|
updateResults().then(() => {
|
||||||
searching = false
|
searching = false
|
||||||
|
}).catch((e) => {
|
||||||
|
console.error(e)
|
||||||
})
|
})
|
||||||
} else {
|
} else {
|
||||||
searching = false
|
searching = false
|
||||||
|
|||||||
@@ -87,13 +87,7 @@ export function getChsSegmenter(): any | undefined {
|
|||||||
}
|
}
|
||||||
|
|
||||||
export type TextExtractorApi = {
|
export type TextExtractorApi = {
|
||||||
extractText: (
|
extractText: (file: TFile) => Promise<string>
|
||||||
file: TFile,
|
|
||||||
ocrOptions?: {
|
|
||||||
langs: string[]
|
|
||||||
}
|
|
||||||
) => Promise<string>
|
|
||||||
getOcrLangs: () => string[]
|
|
||||||
canFileBeExtracted: (filePath: string) => boolean
|
canFileBeExtracted: (filePath: string) => boolean
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -46,7 +46,9 @@ export default class OmnisearchPlugin extends Plugin {
|
|||||||
id: 'show-modal-infile',
|
id: 'show-modal-infile',
|
||||||
name: 'In-file search',
|
name: 'In-file search',
|
||||||
editorCallback: (_editor, view) => {
|
editorCallback: (_editor, view) => {
|
||||||
new OmnisearchInFileModal(app, view.file).open()
|
if (view.file) {
|
||||||
|
new OmnisearchInFileModal(app, view.file).open()
|
||||||
|
}
|
||||||
},
|
},
|
||||||
})
|
})
|
||||||
|
|
||||||
|
|||||||
@@ -202,6 +202,9 @@ export function getTagsFromMetadata(metadata: CachedMetadata | null): string[] {
|
|||||||
* https://stackoverflow.com/a/37511463
|
* https://stackoverflow.com/a/37511463
|
||||||
*/
|
*/
|
||||||
export function removeDiacritics(str: string): string {
|
export function removeDiacritics(str: string): string {
|
||||||
|
if (str === null || str === undefined) {
|
||||||
|
return ''
|
||||||
|
}
|
||||||
return str.normalize('NFD').replace(/\p{Diacritic}/gu, '')
|
return str.normalize('NFD').replace(/\p{Diacritic}/gu, '')
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user