codePreviews: add % to regex

This commit is contained in:
Cynthia Foxwell 2023-12-06 18:42:50 -07:00
parent d35c530e87
commit 480228a417
1 changed files with 3 additions and 3 deletions

View File

@ -3,11 +3,11 @@ const {MessageFlags} = require("@projectdysnomia/dysnomia").Constants;
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\/([a-z0-9-_.#/]*)(\s*\|\|)?/gi;
/(?:\s|^)(\|\|\s*)?https?:\/\/.+?\/[a-z0-9-]+\/[a-z0-9-]+\/src\/branch\/([a-z0-9-_.#/%]*)(\s*\|\|)?/gi;
const REGEX_SPOILER = /(?:\s|^)\|\|([\s\S]+?)\|\|/;
function unindent(str) {