mirror of
https://github.com/CherryHQ/cherry-studio.git
synced 2025-12-24 10:40:07 +08:00
fix(Markdown/Link): set href to undefined when it's empty (#9343)
fix(Markdown/Link): 处理空链接时设置href为undefined
This commit is contained in:
parent
174b9bdc3d
commit
1af4a2686b
@ -1,4 +1,4 @@
|
||||
import { omit } from 'lodash'
|
||||
import { isEmpty, omit } from 'lodash'
|
||||
import React from 'react'
|
||||
import type { Node } from 'unist'
|
||||
|
||||
@ -33,6 +33,7 @@ const Link: React.FC<LinkProps> = (props) => {
|
||||
<CitationTooltip citation={props.citationData}>
|
||||
<a
|
||||
{...omit(props, ['node', 'citationData'])}
|
||||
href={isEmpty(props.href) ? undefined : props.href}
|
||||
target="_blank"
|
||||
rel="noreferrer"
|
||||
onClick={(e) => e.stopPropagation()}
|
||||
|
||||
Loading…
Reference in New Issue
Block a user