From e8a99e950428f4d5da241aa52bb0ec357af3e621 Mon Sep 17 00:00:00 2001
From: bb1950328 <bb1950328@gmail.com>
Date: Sat, 30 Jan 2021 12:47:47 +0000
Subject: [PATCH] make the external link check also work for relative hrefs

---
 assets/js/index.js |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/assets/js/index.js b/assets/js/index.js
index b585603..2d64647 100644
--- a/assets/js/index.js
+++ b/assets/js/index.js
@@ -131,7 +131,7 @@
     if(links) {
       Array.from(links).forEach(function(link, index){
         let target, rel, blank, noopener, attr1, attr2, url, isExternal;
-        url = new URL(elemAttribute(link, 'href'));
+        url = new URL(link.href);
         // definition of same origin: RFC 6454, section 4 (https://tools.ietf.org/html/rfc6454#section-4)
         isExternal = url.host !== location.host || url.protocol !== location.protocol || url.port !== location.port;
         if(isExternal) {

--
Gitblit v1.10.0