remove unicode ltr chars and replace with css (#8826)

This commit is contained in:
Samuel Newman
2025-08-12 15:59:03 +03:00
committed by GitHub
parent 683d7bf5a7
commit bf869d9185
2 changed files with 21 additions and 5 deletions
+9 -2
View File
@@ -25,10 +25,17 @@ export function isInvalidHandle(handle: string): boolean {
return handle === 'handle.invalid'
}
export function sanitizeHandle(handle: string, prefix = ''): string {
export function sanitizeHandle(
handle: string,
prefix = '',
forceLeftToRight = true,
): string {
const lowercasedWithPrefix = `${prefix}${handle.toLocaleLowerCase()}`
return isInvalidHandle(handle)
? '⚠Invalid Handle'
: forceLTR(`${prefix}${handle.toLocaleLowerCase()}`)
: forceLeftToRight
? forceLTR(lowercasedWithPrefix)
: lowercasedWithPrefix
}
export interface IsValidHandle {