Add bidi strip setting and use in os dialogs

This commit is contained in:
Jamie Kyle 2024-07-15 16:15:18 -07:00 committed by GitHub
parent a710f09977
commit 07195f4096
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
5 changed files with 32 additions and 15 deletions

View file

@ -109,7 +109,8 @@ export const ANY_UNICODE_DIR_CONTROL_CHAR_REGEX = new RegExp(
POP_DIRECTIONAL_FORMATTING,
LTR_OVERRIDE,
RTL_OVERRIDE,
].join('|')
].join('|'),
'g'
);
export function hasAnyUnicodeDirControlChars(input: string): boolean {
@ -216,3 +217,7 @@ export function bidiIsolate(text: string): string {
}
return _bidiIsolate(text);
}
export function bidiStrip(text: string): string {
return text.replace(ANY_UNICODE_DIR_CONTROL_CHAR_REGEX, '');
}