chore: do not test for hostname

This commit is contained in:
Reto Aebersold 2023-11-27 12:20:28 +01:00
parent c3ff391968
commit 337b0cc14c
1 changed files with 1 additions and 4 deletions

View File

@ -3,10 +3,7 @@ export const setExternalLinksToOpenInNewTab = (
) => {
const httpRegex = /^https?:\/\//i;
anchors.forEach((anchor: HTMLAnchorElement) => {
if (
httpRegex.test(anchor.href) &&
!anchor.href.includes(window.location.hostname)
) {
if (httpRegex.test(anchor.href)) {
anchor.setAttribute("target", "_blank");
anchor.setAttribute("rel", "noopener noreferrer");
}