mirror of
https://github.com/keymanapp/keyman.git
synced 2026-08-10 02:45:32 +00:00
fix(developer): search-term quote replacement was not global
This commit is contained in:
parent
dd6b942182
commit
94433f74eb
1 changed files with 7 additions and 9 deletions
|
|
@ -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, '"');
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue