From c86de7b08981c80fa042685f4814c370a4ce2f4c Mon Sep 17 00:00:00 2001 From: Matthew Merrill Date: Sun, 14 Jun 2020 00:22:39 -0700 Subject: [PATCH] Only replace .git if it occurs at the end. (#37) Previously, foo/bar.github.io would be turned into foo/barhub.io. --- js/main.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/js/main.js b/js/main.js index e19aae8..a4e1ebb 100644 --- a/js/main.js +++ b/js/main.js @@ -99,7 +99,7 @@ function initDT() { function fetchAndShow(repo) { repo = repo.replace('https://github.com/', ''); repo = repo.replace('http://github.com/', ''); - repo = repo.replace('.git', ''); + repo = repo.replace(/.git$/, ''); fetch( `https://api.github.com/repos/${repo}/forks?sort=stargazers&per_page=100`