forked from Mirrors/elk
fix: mention link in rich content
This commit is contained in:
parent
e16b7dd9fe
commit
1bf60dc4a2
1 changed files with 3 additions and 3 deletions
|
@ -29,11 +29,11 @@ export function nodeToVNode(node: Node): VNode | string | null {
|
||||||
if ('children' in node) {
|
if ('children' in node) {
|
||||||
if (node.name === 'a' && (node.attributes.href?.startsWith('/') || node.attributes.href?.startsWith('.'))) {
|
if (node.name === 'a' && (node.attributes.href?.startsWith('/') || node.attributes.href?.startsWith('.'))) {
|
||||||
node.attributes.to = node.attributes.href
|
node.attributes.to = node.attributes.href
|
||||||
delete node.attributes.href
|
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
||||||
delete node.attributes.target
|
const { href, target, ...attrs } = node.attributes
|
||||||
return h(
|
return h(
|
||||||
RouterLink as any,
|
RouterLink as any,
|
||||||
node.attributes,
|
attrs,
|
||||||
() => node.children.map(treeToVNode),
|
() => node.children.map(treeToVNode),
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue