fix: Support uppercase letters in gist link (#2696)

This commit is contained in:
dkkb
2021-10-27 23:20:39 +08:00
committed by GitHub
parent 030419fa80
commit 67f06895e7
2 changed files with 7 additions and 1 deletions

View File

@ -2,7 +2,7 @@
import * as React from "react";
const URL_REGEX = new RegExp(
"^https://gist.github.com/([a-z\\d](?:[a-z\\d]|-(?=[a-z\\d])){0,38})/(.*)$"
"^https://gist.github.com/([a-zA-Z\\d](?:[a-zA-Z\\d]|-(?=[a-zA-Z\\d])){0,38})/(.*)$"
);
type Props = {|

View File

@ -15,6 +15,12 @@ describe("Gist", () => {
match
)
).toBeTruthy();
expect(
"https://gist.github.com/ShubhanjanMedhi-dev/900c9c14093611898a4a085938bb90d9".match(
match
)
).toBeTruthy();
});
test("to not be enabled elsewhere", () => {