tangled
alpha
login
or
join now
cosmik.network
/
semble
43
fork
atom
A social knowledge tool for researchers built on ATProto
43
fork
atom
overview
issues
13
pulls
pipelines
fix: RTL override for display names
Pouria Delfanazari
5 months ago
9eb787bf
17c00aa6
+11
-1
2 changed files
expand all
collapse all
unified
split
src
webapp
features
feeds
components
feedActivityStatus
FeedActivityStatus.tsx
lib
utils
text.ts
+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
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
32
-
{props.user.name}
33
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
8
+
9
9
+
export const sanitizeText = (text: string): string => {
10
10
+
if (typeof text !== 'string') {
11
11
+
return '';
12
12
+
}
13
13
+
14
14
+
// remove known bidirectional control characters
15
15
+
return text.replace(/[\u202E\u202D\u202B\u200F\u200E\u202C\u200C]/g, '');
16
16
+
};