From 41991bcac261a23a852025b7085d98649604b9f3 Mon Sep 17 00:00:00 2001 From: FloatingGhost Date: Sat, 29 Jan 2022 13:09:55 +0000 Subject: [PATCH] fix masto link handling --- src/components/rich_content/rich_content.jsx | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/src/components/rich_content/rich_content.jsx b/src/components/rich_content/rich_content.jsx index abe7db2f..f056db88 100644 --- a/src/components/rich_content/rich_content.jsx +++ b/src/components/rich_content/rich_content.jsx @@ -110,9 +110,19 @@ export default Vue.component('RichContent', { const renderLink = (attrs, children) => { const updatedLink = attrs['href'].replace(/&/g, '&') - const updatedChildren = children.map(child => child.replace(attrs['href'], updatedLink)) + const updatedChildren = children.map(child => { + if (typeof child === 'string') { + return child.replace(attrs['href'], updatedLink) + } + if (child[0] === '') { + return + { child[1] } + + } + return child[1] + }) return - { updatedChildren } + { ...updatedChildren } } // Processor to use with html_tree_converter