From abac959d03c5a35021744180a16ece1d4143311b Mon Sep 17 00:00:00 2001 From: Mary <148872143+mary-ext@users.noreply.github.com> Date: Wed, 24 Jan 2024 01:39:13 +0700 Subject: Resolve facets on list descriptions (#2485) * feat: add strict/loose link mapping * feat: resolve facets on list description --- src/lib/strings/rich-text-helpers.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/lib/strings/rich-text-helpers.ts') 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 } -- cgit 1.4.1