codePreviews: fix repo name regex

This commit is contained in:
Cynthia Foxwell 2024-06-01 22:58:46 -06:00
parent 76ed5b74af
commit 8fcbb1315c

View file

@ -6,11 +6,11 @@ const {getOption} = require("../lib/interactionDispatcher.js");
const events = require("../lib/events.js");
const {hasFlag} = require("../lib/guildSettings.js");
const REGEX_GITHUB =
/(?:\s|^)(\|\|\s*)?https?:\/\/(www\.)?github\.com\/[a-z0-9-]+\/[a-z0-9-]+\/blob\/([a-z0-9-_.?&=#/%]*)(\s*\|\|)?/gi;
/(?:\s|^)(\|\|\s*)?https?:\/\/(www\.)?github\.com\/[a-z0-9-]+\/[a-z0-9-._]+\/blob\/([a-z0-9-_.?&=#/%]*)(\s*\|\|)?/gi;
const REGEX_GITLAB =
/(?:\s|^)(\|\|\s*)?https?:\/\/.+?\/[a-z0-9-]+\/[a-z0-9-]+\/-\/blob\/([a-z0-9-_.?&=#/%]*)(\s*\|\|)?/gi;
/(?:\s|^)(\|\|\s*)?https?:\/\/.+?\/[a-z0-9-]+\/[a-z0-9-._]+\/-\/blob\/([a-z0-9-_.?&=#/%]*)(\s*\|\|)?/gi;
const REGEX_GITEA =
/(?:\s|^)(\|\|\s*)?https?:\/\/.+?\/[a-z0-9-]+\/[a-z0-9-]+\/src\/(branch|commit)\/([a-z0-9-_.?&=#/%]*)(\s*\|\|)?/gi;
/(?:\s|^)(\|\|\s*)?https?:\/\/.+?\/[a-z0-9-]+\/[a-z0-9-._]+\/src\/(branch|commit)\/([a-z0-9-_.?&=#/%]*)(\s*\|\|)?/gi;
const REGEX_SPOILER = /(?:\s|^)\|\|([\s\S]+?)\|\|/;
function unindent(str) {