diff --git a/source/app/web/statics/about/script.js b/source/app/web/statics/about/script.js index 04a46c5e..4a04ff71 100644 --- a/source/app/web/statics/about/script.js +++ b/source/app/web/statics/about/script.js @@ -61,15 +61,15 @@ const baseUrl = String.raw`https?:\/\/(?:www\.)?github.com\/([\w.-]+\/[\w.-]+)\/` return value .replace( - RegExp(baseUrl + String.raw`(?:issues|pull|discussions)\/(\d+)(?:\?\S+)?(#\S+)?`, "g"), + RegExp(baseUrl + String.raw`(?:issues|pull|discussions)\/(\d+)(?:\?[\w-]+)?(#[\w-]+)?(?=<)`, "g"), (_, repo, id, comment) => (options?.repo === repo ? "" : repo) + `#${id}` + (comment ? ` (comment)` : ""), ) // -> 'lowlighter/metrics#123' .replace( - RegExp(baseUrl + String.raw`commit\/([\da-f]+)`, "g"), + RegExp(baseUrl + String.raw`commit\/([\da-f]+)(?=<)`, "g"), (_, repo, sha) => (options?.repo === repo ? "" : repo + "@") + sha, ) // -> 'lowlighter/metrics@123abc' .replace( - RegExp(baseUrl + String.raw`compare\/(\S+...\S+)`, "g"), + RegExp(baseUrl + String.raw`compare\/([\w-.]+...[\w-.]+)(?=<)`, "g"), (_, repo, tags) => (options?.repo === repo ? "" : repo + "@") + tags, ) // -> 'lowlighter/metrics@1.0...1.1' }