Fix: issue#190 (#317)
* Fixed search results with diacritics - Caches are now stored with diacritics regardless of settings.ignoreDiacritics - Modified getMatches() behavior to return results with correct form - Modified ResultItemVault.svelte * Fixed highlighting words with comma and period - remove commas and periods from matches * Fixed highlighting of Cyrillic characters - changed highlight regexp determination to be based on character type * Fixed highlighting problem of Japanese and Korean - marked some Japanese diacritics to escape removal - added NFC normalization to keep right form of Korean character * Fixed highlighting of words with punctuation - deleted space/punctuation list from stringsToRegex() - it seems to be working correctly with words with punctuation and hyphenated words AFAIK * Deleted some unused imports * Modified the comment * Added comment * Fixed highlighting issue with comma and period * Fixed highlighting issue with caret and other symbols - Added `^` to separators - Changed regex to use separators - Added escape of `^` from diacritics removal
This commit is contained in:
@@ -17,7 +17,6 @@ import {
|
||||
isFilenameIndexable,
|
||||
logDebug,
|
||||
makeMD5,
|
||||
removeDiacritics,
|
||||
} from './tools/utils'
|
||||
import type { CanvasData } from 'obsidian/canvas'
|
||||
import type { AsPlainObject } from 'minisearch'
|
||||
@@ -115,7 +114,6 @@ async function getAndMapIndexedDocument(
|
||||
console.warn(`Omnisearch: ${content} content for file`, file.path)
|
||||
content = ''
|
||||
}
|
||||
content = removeDiacritics(content)
|
||||
const metadata = app.metadataCache.getFileCache(file)
|
||||
|
||||
// Look for links that lead to non-existing files,
|
||||
@@ -143,7 +141,7 @@ async function getAndMapIndexedDocument(
|
||||
|
||||
const tags = getTagsFromMetadata(metadata)
|
||||
return {
|
||||
basename: removeDiacritics(file.basename),
|
||||
basename: file.basename,
|
||||
content,
|
||||
path: file.path,
|
||||
mtime: file.stat.mtime,
|
||||
|
||||
Reference in New Issue
Block a user