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

This commit is contained in:
Nonpawit Teerachetmongkol authored and GitHub committed 2020-11-05 09:03:16 -08:00
1 parent 1b6a986986
commit fdaa36c9fd
2 files changed
+7 -1

No files matched your search

+1 -1
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 = {|
+6
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", () => {