about summary refs log tree commit diff
path: root/src/lib/strings/rich-text-helpers.ts
diff options
context:
space:
mode:
authorMary <148872143+mary-ext@users.noreply.github.com>2024-01-24 01:39:13 +0700
committerGitHub <noreply@github.com>2024-01-23 10:39:13 -0800
commitabac959d03c5a35021744180a16ece1d4143311b (patch)
tree5bf18cf6d813a14f40433bfd0a6d853d419c62b5 /src/lib/strings/rich-text-helpers.ts
parent1828bc9755c480812cc4b28be579e87793cd956b (diff)
downloadvoidsky-abac959d03c5a35021744180a16ece1d4143311b.tar.zst
Resolve facets on list descriptions (#2485)
* feat: add strict/loose link mapping

* feat: resolve facets on list description
Diffstat (limited to 'src/lib/strings/rich-text-helpers.ts')
-rw-r--r--src/lib/strings/rich-text-helpers.ts4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/lib/strings/rich-text-helpers.ts b/src/lib/strings/rich-text-helpers.ts
index 08971ca03..662004599 100644
--- a/src/lib/strings/rich-text-helpers.ts
+++ b/src/lib/strings/rich-text-helpers.ts
@@ -1,7 +1,7 @@
 import {AppBskyRichtextFacet, RichText} from '@atproto/api'
 import {linkRequiresWarning} from './url-helpers'
 
-export function richTextToString(rt: RichText): string {
+export function richTextToString(rt: RichText, loose: boolean): string {
   const {text, facets} = rt
 
   if (!facets?.length) {
@@ -19,7 +19,7 @@ export function richTextToString(rt: RichText): string {
 
       const requiresWarning = linkRequiresWarning(href, text)
 
-      result += !requiresWarning ? href : `[${text}](${href})`
+      result += !requiresWarning ? href : loose ? `[${text}](${href})` : text
     } else {
       result += segment.text
     }