fix hashtag links opening in new tabs (#2373)
This commit is contained in:
parent
c77d10dad2
commit
0299bbe4bc
@ -133,9 +133,9 @@ export default memo(function Text ({ rel = UNKNOWN_LINK_REL, imgproxyUrls, child
|
|||||||
if (outlawed) {
|
if (outlawed) {
|
||||||
return href
|
return href
|
||||||
}
|
}
|
||||||
|
const isHashLink = href.startsWith('#')
|
||||||
// eslint-disable-next-line
|
// eslint-disable-next-line
|
||||||
return <Link id={props.id} target='_blank' rel={rel} href={href}>{children}</Link>
|
return <Link id={props.id} target={isHashLink ? undefined : '_blank'} rel={rel} href={href}>{children}</Link>
|
||||||
},
|
},
|
||||||
img: TextMediaOrLink,
|
img: TextMediaOrLink,
|
||||||
embed: (props) => <Embed {...props} topLevel={topLevel} />
|
embed: (props) => <Embed {...props} topLevel={topLevel} />
|
||||||
|
Loading…
x
Reference in New Issue
Block a user