Skip to content
This repository was archived by the owner on Apr 7, 2025. It is now read-only.

Commit 33739eb

Browse files
committed
fix: dont open relative links in a new tab
1 parent 3f9cca9 commit 33739eb

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

plugins/remark-external-link-icon/index.js

+3-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,9 @@ const visit = require('unist-util-visit');
33
const remarkExternalLinks = () => (tree) => {
44
const isTarget = (node) => {
55
return (
6-
node.type === 'link' && node.url.indexOf('opensource.newrelic.com') < 0
6+
node.type === 'link' &&
7+
node.url.indexOf('opensource.newrelic.com') < 0 &&
8+
!node.url.startsWith('/')
79
);
810
};
911

0 commit comments

Comments
 (0)