From 33607e74a74bec7f7899879a71ac877a9b63c351 Mon Sep 17 00:00:00 2001 From: eight Date: Thu, 12 Oct 2017 16:15:45 +0800 Subject: [PATCH] Fix: let makeAuthor use makeLink --- install-usercss/install-usercss.js | 17 +++++------------ 1 file changed, 5 insertions(+), 12 deletions(-) diff --git a/install-usercss/install-usercss.js b/install-usercss/install-usercss.js index a915c064..e736081d 100644 --- a/install-usercss/install-usercss.js +++ b/install-usercss/install-usercss.js @@ -101,11 +101,7 @@ const [, name, email, url] = match; const frag = document.createDocumentFragment(); if (email) { - frag.appendChild($element({ - tag: 'a', - textContent: name, - href: `mailto:${email}` - })); + frag.appendChild(makeLink(`mailto:${email}`, name)); } else { frag.appendChild($element({ tag: 'span', @@ -113,17 +109,14 @@ })); } if (url) { - frag.appendChild($element({ - tag: 'a', - href: url, - target: '_blank', - rel: 'noopener', - appendChild: $element({ + frag.appendChild(makeLink( + url, + $element({ tag: 'img', className: 'icon', src: '/install-usercss/external.svg' }) - })); + )); } return frag; }