From 232a029de68e7e238dfb066a74185ae78c75da49 Mon Sep 17 00:00:00 2001 From: Ines Montani Date: Thu, 5 Sep 2019 10:41:46 +0200 Subject: [PATCH] Send referrer for internal links [ci skip] --- website/src/components/link.js | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/website/src/components/link.js b/website/src/components/link.js index 35b3c23cf..4c4aa9492 100644 --- a/website/src/components/link.js +++ b/website/src/components/link.js @@ -8,6 +8,8 @@ import Icon from './icon' import classes from '../styles/link.module.sass' import { isString } from './util' +const internalRegex = /(http(s?)):\/\/(prodi.gy|spacy.io|irl.spacy.io)/gi + const Whitespace = ({ children }) => ( // Ensure that links are always wrapped in spaces <> {children} @@ -68,13 +70,15 @@ const Link = ({ ) } + const isInternal = internalRegex.test(dest) + const rel = isInternal ? null : 'noopener nofollow noreferrer' return ( {content}