Merge pull request #1990 from Wevah/master

Use classList instead of string manipulation
This commit is contained in:
Maurice Parker 2020-04-17 08:27:25 -05:00 committed by GitHub
commit 9516f1395c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 1 additions and 6 deletions

View File

@ -117,12 +117,7 @@ function isLocalFootnote(target) {
function styleLocalFootnotes() {
for (elem of document.querySelectorAll("sup > a[href*='#fn'], sup > div > a[href*='#fn']")) {
if (isLocalFootnote(elem)) {
if (elem.className.indexOf("footnote") === -1) {
if (elem.className.length === 0)
elem.className = "footnote";
else
elem.className = elem.className + " " + "footnote";
}
elem.classList.add("footnote");
}
}
}