fix: gist not support username contains numbers (#1622)

This commit is contained in:
Nonpawit Teerachetmongkol
2020-11-06 00:03:16 +07:00
committed by GitHub
parent 1b6a986986
commit fdaa36c9fd
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-zd](?:[a-zd]|-(?=[a-zd])){0,38})/(.*)$"
"^https://gist.github.com/([a-z\\d](?:[a-z\\d]|-(?=[a-z\\d])){0,38})/(.*)$"
);
type Props = {|

View File

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