Bluesky app fork with some witchin' additions 💫
0
fork

Configure Feed

Select the types of activity you want to include in your feed.

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

authored by

Samuel Newman and committed by
GitHub
bf869d91 683d7bf5

+21 -5
+9 -2
src/lib/strings/handles.ts
··· 25 25 return handle === 'handle.invalid' 26 26 } 27 27 28 - export function sanitizeHandle(handle: string, prefix = ''): string { 28 + export function sanitizeHandle( 29 + handle: string, 30 + prefix = '', 31 + forceLeftToRight = true, 32 + ): string { 33 + const lowercasedWithPrefix = `${prefix}${handle.toLocaleLowerCase()}` 29 34 return isInvalidHandle(handle) 30 35 ? '⚠Invalid Handle' 31 - : forceLTR(`${prefix}${handle.toLocaleLowerCase()}`) 36 + : forceLeftToRight 37 + ? forceLTR(lowercasedWithPrefix) 38 + : lowercasedWithPrefix 32 39 } 33 40 34 41 export interface IsValidHandle {
+12 -3
src/screens/Profile/Header/Handle.tsx
··· 4 4 import {useLingui} from '@lingui/react' 5 5 6 6 import {isInvalidHandle, sanitizeHandle} from '#/lib/strings/handles' 7 - import {isIOS} from '#/platform/detection' 7 + import {isIOS, isNative} from '#/platform/detection' 8 8 import {type Shadow} from '#/state/cache/types' 9 9 import {atoms as a, useTheme, web} from '#/alf' 10 10 import {NewskieDialog} from '#/components/NewskieDialog' ··· 47 47 {borderColor: t.palette.contrast_200}, 48 48 ] 49 49 : [a.text_md, a.leading_snug, t.atoms.text_contrast_medium], 50 - web({wordBreak: 'break-all'}), 50 + web({ 51 + wordBreak: 'break-all', 52 + direction: 'ltr', 53 + unicodeBidi: 'isolate', 54 + }), 51 55 ]}> 52 56 {invalidHandle 53 57 ? _(msg`⚠Invalid Handle`) 54 - : sanitizeHandle(profile.handle, '@')} 58 + : sanitizeHandle( 59 + profile.handle, 60 + '@', 61 + // forceLTR handled by CSS above on web 62 + isNative, 63 + )} 55 64 </Text> 56 65 </View> 57 66 )