diff options
author | Paul Frazee <pfrazee@gmail.com> | 2022-11-22 13:16:40 -0600 |
---|---|---|
committer | Paul Frazee <pfrazee@gmail.com> | 2022-11-22 13:16:40 -0600 |
commit | ce56d4e34e75258104b26e2cdc14c423d937a8af (patch) | |
tree | b0d29452db7bcdf53757a66c3e372ae7ad7fe04a /src/view/com/util/RichText.tsx | |
parent | 27db820a9d9731a16161d08f20e224f7e77a6af5 (diff) | |
download | voidsky-ce56d4e34e75258104b26e2cdc14c423d937a8af.tar.zst |
Shorten rendered URLs in posts
Diffstat (limited to 'src/view/com/util/RichText.tsx')
-rw-r--r-- | src/view/com/util/RichText.tsx | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/src/view/com/util/RichText.tsx b/src/view/com/util/RichText.tsx index f865c873a..3c54094ba 100644 --- a/src/view/com/util/RichText.tsx +++ b/src/view/com/util/RichText.tsx @@ -1,7 +1,8 @@ import React from 'react' -import {Text, TextStyle, StyleProp, View} from 'react-native' +import {Text, TextStyle, StyleProp} from 'react-native' import {TextLink} from './Link' import {s} from '../../lib/styles' +import {toShortUrl} from '../../../lib/strings' type TextSlice = {start: number; end: number} type Entity = { @@ -45,7 +46,7 @@ export function RichText({ els.push( <TextLink key={key} - text={segment.text} + text={toShortUrl(segment.text)} href={segment.entity.value} style={[style, s.blue3]} />, |