fix: mention link in rich content

zio/stable
三咲智子 2022-12-27 02:39:29 +08:00
parent e16b7dd9fe
commit 1bf60dc4a2
No known key found for this signature in database
GPG Key ID: 69992F2250DFD93E
1 changed files with 3 additions and 3 deletions

View File

@ -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),
)
}