fix: simpleicons title override link title error (#270)

This commit is contained in:
Dillon
2020-04-28 02:19:58 +08:00
committed by GitHub
parent 66d45520a9
commit 9003e18ada
3 changed files with 4 additions and 2 deletions

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@@ -52,6 +52,8 @@ class Theme {
const $svg = $temp.firstChild; const $svg = $temp.firstChild;
$svg.setAttribute('data-svg-src', $icon.getAttribute('data-svg-src')); $svg.setAttribute('data-svg-src', $icon.getAttribute('data-svg-src'));
$svg.classList.add('icon'); $svg.classList.add('icon');
const $titleElements = $svg.getElementsByTagName('title');
if ($titleElements.length) $svg.removeChild($titleElements[0]);
$icon.parentElement.replaceChild($svg, $icon); $icon.parentElement.replaceChild($svg, $icon);
}) })
.catch(console.error.bind(console)); .catch(console.error.bind(console));