How to open link on new tab? #1135
-
How do I configure so every link opens with |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 3 replies
-
Heya @igorroc 👋 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 |
Beta Was this translation helpful? Give feedback.
-
Hello @ChristianMurphy , how can I make it works in a react-markdown element? |
Beta Was this translation helpful? Give feedback.
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
useshProperties
https://github.com/syntax-tree/mdast-util-to-hast#fields-on-nodes