From 1bf60dc4a2a3709aced4375469b30a89f3339248 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E4=B8=89=E5=92=B2=E6=99=BA=E5=AD=90?= Date: Tue, 27 Dec 2022 02:39:29 +0800 Subject: [PATCH] fix: mention link in rich content --- composables/content-render.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/composables/content-render.ts b/composables/content-render.ts index 2affedf2..c4938a87 100644 --- a/composables/content-render.ts +++ b/composables/content-render.ts @@ -29,11 +29,11 @@ export function nodeToVNode(node: Node): VNode | string | null { if ('children' in node) { if (node.name === 'a' && (node.attributes.href?.startsWith('/') || node.attributes.href?.startsWith('.'))) { node.attributes.to = node.attributes.href - delete node.attributes.href - delete node.attributes.target + // eslint-disable-next-line @typescript-eslint/no-unused-vars + const { href, target, ...attrs } = node.attributes return h( RouterLink as any, - node.attributes, + attrs, () => node.children.map(treeToVNode), ) }