diff --git a/composables/content-parse.ts b/composables/content-parse.ts index f6e0aab7..8deaa57a 100644 --- a/composables/content-parse.ts +++ b/composables/content-parse.ts @@ -10,6 +10,7 @@ export interface ContentParseOptions { markdown?: boolean replaceUnicodeEmoji?: boolean astTransforms?: Transform[] + convertMentionLink?: boolean } const sanitizerBasicClasses = filterClasses(/^(h-\S*|p-\S*|u-\S*|dt-\S*|e-\S*|mention|hashtag|ellipsis|invisible)$/u) @@ -53,6 +54,7 @@ export function parseMastodonHTML( const { markdown = true, replaceUnicodeEmoji = true, + convertMentionLink = false, } = options if (markdown) { @@ -77,6 +79,9 @@ export function parseMastodonHTML( if (markdown) transforms.push(transformMarkdown) + if (convertMentionLink) + transforms.push(transformMentionLink) + transforms.push(replaceCustomEmoji(options.emojis || {})) transforms.push(transformParagraphs) @@ -92,6 +97,7 @@ export function convertMastodonHTML(html: string, customEmojis: Record