A social knowledge tool for researchers built on ATProto

fix: RTL override for display names

+11 -1
+2 -1
src/webapp/features/feeds/components/feedActivityStatus/FeedActivityStatus.tsx
··· 4 4 import Link from 'next/link'; 5 5 import { getRelativeTime } from '@/lib/utils/time'; 6 6 import { getRecordKey } from '@/lib/utils/atproto'; 7 + import { sanitizeText } from '@/lib/utils/text'; 7 8 8 9 interface Props { 9 10 user: FeedItem['user']; ··· 29 30 c="blue" 30 31 fw={600} 31 32 > 32 - {props.user.name} 33 + {sanitizeText(props.user.name)} 33 34 </Anchor>{' '} 34 35 {collections.length === 0 ? ( 35 36 'added to library'
+9
src/webapp/lib/utils/text.ts
··· 5 5 6 6 return text.slice(0, maxLength) + '...'; 7 7 }; 8 + 9 + export const sanitizeText = (text: string): string => { 10 + if (typeof text !== 'string') { 11 + return ''; 12 + } 13 + 14 + // remove known bidirectional control characters 15 + return text.replace(/[\u202E\u202D\u202B\u200F\u200E\u202C\u200C]/g, ''); 16 + };