Skip to content

Commit

Permalink
Fix issue with protocols within URLs
Browse files Browse the repository at this point in the history
  • Loading branch information
proginosko committed Jan 22, 2022
1 parent 8cd145b commit 8493a72
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion common.js
Original file line number Diff line number Diff line change
Expand Up @@ -199,7 +199,8 @@ function getParsedURL(url) {
// Clean list of sites
//
function cleanSites(sites) {
sites = sites.replace(/\s+/g, " ").replace(/(^ +)|( +$)|(\w+:\/+)/g, "");
sites = sites.replace(/\s+/g, " ").replace(/(^ +)|( +$)/g, ""); // remove extra whitespace
sites = sites.replace(/^\w+:\/+/, "").replace(/ \w+:\/+/g, " "); // remove protocols
sites = sites.split(" ").sort().join(" "); // sort alphabetically
return sites;
}
Expand Down

0 comments on commit 8493a72

Please sign in to comment.