update-badge: fix external link parsing

This commit is contained in:
ndunnett committed 2024-05-22 23:22:33 +00:00
1 parent dd850da3d0
commit 7ee935c6ed
6 files changed
+13 -19

No files matched your search

+2 -8
View File
@@ -92,14 +92,8 @@ function parseGithubRepos (lines) {
}
function otherDomain (line) {
return (
!(
line.indexOf('[') < line.indexOf('/') &&
line.indexOf(']') > line.indexOf('/')
) ||
line.indexOf('gitlab.com') !== -1 ||
line.indexOf('gist.github.com') !== -1
)
const match = line.match(/\[[^\[\]\s]+\]\((?<link>[^\(\)\s]+)\)/)
return match !== null && !match.groups.link.startsWith('https://github.com/')
}
function generateLine (repo) {