Hack text breaks

This commit is contained in:
Eric Bailey
2024-08-29 13:14:59 -05:00
parent 0a364f6957
commit cd2ddd21ef
2 changed files with 8 additions and 5 deletions
+7 -4
View File
@@ -15,7 +15,7 @@ export function RichText({
cx?: Record<string, any>[] cx?: Record<string, any>[]
}) { }) {
const {text, facets} = value const {text, facets} = value
const baseStyles = [a.leading_snug, ...cx] const baseStyles = [a.leading_snug, {whiteSpace: 'pre-wrap'}, ...cx]
const linkStyles = [ const linkStyles = [
{ {
color: t.palette.primary_500, color: t.palette.primary_500,
@@ -49,7 +49,7 @@ export function RichText({
} else if (link && AppBskyRichtextFacet.validateLink(link).success) { } else if (link && AppBskyRichtextFacet.validateLink(link).success) {
const url = toShortUrl(text) const url = toShortUrl(text)
if (disableLinks) { if (disableLinks) {
els.push(<span key={key}>{url}</span>) els.push(url)
} else { } else {
els.push( els.push(
<span key={key} style={s(linkStyles)}> <span key={key} style={s(linkStyles)}>
@@ -64,11 +64,14 @@ export function RichText({
) { ) {
els.push( els.push(
<span key={key} style={s(linkStyles)}> <span key={key} style={s(linkStyles)}>
{segment.text} {text}
</span>, </span>,
) )
} else { } else {
els.push(<span key={key}>{segment.text}</span>) els.push(text)
}
if (/\n/.test(text)) {
els.push(<span key={key} style={{width: '100%'}} />)
} }
key++ key++
} }
+1 -1
View File
@@ -15,7 +15,7 @@ export function Text({
a.flex, a.flex,
a.flex_wrap, a.flex_wrap,
{ {
columnGap: a.gap_xs.gap, columnGap: '1px',
}, },
a.font_normal, a.font_normal,
a.leading_tight, a.leading_tight,