fix(developer): search-term quote replacement was not global

This commit is contained in:
Joshua A. Horton 2024-03-05 12:23:29 +07:00
parent dd6b942182
commit 94433f74eb

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, '"');
}
/**
@ -62,14 +60,14 @@ export function defaultCasedSearchTermToKey(wordform: string, applyCasing: Casin
// Remove any combining diacritics (if input is in NFKD)
.replace(/[\u0300-\u036F]/g, '')
) // end of `Array.from`
.map(function(c) { return applyCasing('lower', c)})
.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, '"');
}
/**