mirror of
https://github.com/gristlabs/grist-core.git
synced 2026-03-02 04:09:24 +00:00
Ignore diacritics in autocomplete
Works for: - Choice - Choice List - Reference - Reference List Co-Authored-By: Louis Delbosc <louis.delbosc.prestataire@anct.gouv.fr>
This commit is contained in:
@@ -55,6 +55,11 @@ export function capitalizeFirstWord(str: string): string {
|
||||
return str.replace(/\b[a-z]/i, c => c.toUpperCase());
|
||||
}
|
||||
|
||||
// Remove diacritics (accents and other signs).
|
||||
export function removeDiacritics(text: string): string {
|
||||
return text.normalize("NFKD").replace(/[\u0300-\u036f]/g, "")
|
||||
}
|
||||
|
||||
// Returns whether the string n represents a valid number.
|
||||
// http://stackoverflow.com/questions/18082/validate-numbers-in-javascript-isnumeric
|
||||
export function isNumber(n: string): boolean {
|
||||
|
||||
Reference in New Issue
Block a user