Pseuds break the url. FIX INCLUDED! First of all, thank you for this code, it's been really helpful for exchanges! Second, I've noticed a bug when dealing with pseuds since that breaks the url. Here's the code to fix it, simply replace line 20 (linkedName.href = "https://archiveofourown.org/users/" + authorName) with this snippet:
Pseuds break the url. FIX INCLUDED!
First of all, thank you for this code, it's been really helpful for exchanges!
Second, I've noticed a bug when dealing with pseuds since that breaks the url. Here's the code to fix it, simply replace line 20 (
linkedName.href = "https://archiveofourown.org/users/" + authorName
) with this snippet:if (authorName.indexOf("(") > -1){
let username = authorName.split("(")[1].split(")")[0];
let pseud = authorName.split(" (")[0];
linkedName.href = "https://archiveofourown.org/users/" + username + "/pseuds/" + pseud;
} else {
linkedName.href = "https://archiveofourown.org/users/" + authorName;
}
Hope this helps!