Is it possible to add target="blank" to Markdown links?
For example I wish to have the following URL open in a new browser tab when I left click:
[link to website](http://www.website.com)
Cheers
You can use a custom renderer:
function LinkRenderer(props) {
return <a href={props.href} target="_blank">{props.children}</a>
}
<ReactMarkdown
source="Click [here](https://espen.codes/) to visit external site"
renderers={{link: LinkRenderer}}
/>
@rexxars renderers={{Link: LinkRenderer}} is incorrect, Link: => link: to lowercase =)
just for this issue`s other viewers
it works here with the capital L in Links:
Can you please consider re-open this ticket in order to implementing support for opening a link in a new tab:
[link](url){:target="_blank"}
Is this feature make sense?
I'm willing to give it a try implementing this.
Most helpful comment
You can use a custom renderer: