Merge pull request #10934 from keymanapp/developer/model-search-term-defaults

fix(developer): search-term quote replacement was not global
This commit is contained in:
Joshua Horton 2024-03-06 08:20:21 +07:00 committed by GitHub
commit 9cb07fbb3a
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -25,11 +25,9 @@ export function defaultSearchTermToKey(wordform: string): string {
// Remove any combining diacritics (if input is in NFKD)
.replace(/[\u0300-\u036F]/g, '')
// Replace directional quotation marks with plain apostrophes
.replace(//, "'")
.replace(//, "'")
.replace(/[]/g, "'")
// Also double-quote marks.
.replace(/“/, '"')
.replace(/”/, '"');
.replace(/[“”]/g, '"');
}
/**
@ -65,11 +63,9 @@ export function defaultCasedSearchTermToKey(wordform: string, applyCasing: Casin
.map(function(c) { return applyCasing('lower', c)})
.join('')
// Replace directional quotation marks with plain apostrophes
.replace(//, "'")
.replace(//, "'")
.replace(/[]/g, "'")
// Also double-quote marks.
.replace(/“/, '"')
.replace(/”/, '"');
.replace(/[“”]/g, '"');
}
/**