feat: gist & co-authors

This commit is contained in:
tdurieux
2026-05-04 13:10:44 +02:00
parent f0f6436370
commit f0bc53f093
24 changed files with 1707 additions and 158 deletions
+11
View File
@@ -147,6 +147,17 @@ function generateRandomId(length) {
function parseGithubUrl(url) {
if (!url) throw "Invalid url";
// Gist URLs: https://gist.github.com/<owner>/<gistId> or
// https://gist.github.com/<gistId>
const gistMatch = url.match(
/gist\.github\.com\/(?:(?<owner>[\w-\._]+)\/)?(?<gist>[a-fA-F0-9]+)/
);
if (gistMatch && gistMatch.groups.gist) {
return {
owner: gistMatch.groups.owner,
gistId: gistMatch.groups.gist,
};
}
const matches = url
.replace(/\.git(\/|$)/, "$1")
.match(