Fix: let makeAuthor use makeLink

This commit is contained in:
eight 2017-10-12 16:15:45 +08:00
parent 40ad7837fc
commit 33607e74a7

View File

@ -101,11 +101,7 @@
const [, name, email, url] = match; const [, name, email, url] = match;
const frag = document.createDocumentFragment(); const frag = document.createDocumentFragment();
if (email) { if (email) {
frag.appendChild($element({ frag.appendChild(makeLink(`mailto:${email}`, name));
tag: 'a',
textContent: name,
href: `mailto:${email}`
}));
} else { } else {
frag.appendChild($element({ frag.appendChild($element({
tag: 'span', tag: 'span',
@ -113,17 +109,14 @@
})); }));
} }
if (url) { if (url) {
frag.appendChild($element({ frag.appendChild(makeLink(
tag: 'a', url,
href: url, $element({
target: '_blank',
rel: 'noopener',
appendChild: $element({
tag: 'img', tag: 'img',
className: 'icon', className: 'icon',
src: '/install-usercss/external.svg' src: '/install-usercss/external.svg'
}) })
})); ));
} }
return frag; return frag;
} }