Skip to content

How to open link on new tab? #1135

Answered by ChristianMurphy
igorroc asked this question in Q&A
Discussion options

You must be logged in to vote

Heya @igorroc 👋
Generally the convention is external links are _blank, and internal links open in the same tab.
This can be done through https://github.com/remarkjs/remark-external-links

If you want every link to open in a new tab, you could create your own plugin (more on that here: https://unifiedjs.com/learn/) and take inspiration from how remark-external-links uses hProperties https://github.com/syntax-tree/mdast-util-to-hast#fields-on-nodes

Replies: 2 comments 3 replies

Comment options

You must be logged in to vote
2 replies
@igorroc
Comment options

@ChristianMurphy
Comment options

Answer selected by ChristianMurphy
Comment options

You must be logged in to vote
1 reply
@ChristianMurphy
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
3 participants