Skip to content

Commit

Permalink
fix: dont open relative links in a new tab
Browse files Browse the repository at this point in the history
  • Loading branch information
jerelmiller committed Jan 31, 2021
1 parent 3f9cca9 commit 33739eb
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion plugins/remark-external-link-icon/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,9 @@ const visit = require('unist-util-visit');
const remarkExternalLinks = () => (tree) => {
const isTarget = (node) => {
return (
node.type === 'link' && node.url.indexOf('opensource.newrelic.com') < 0
node.type === 'link' &&
node.url.indexOf('opensource.newrelic.com') < 0 &&
!node.url.startsWith('/')
);
};

Expand Down

0 comments on commit 33739eb

Please sign in to comment.