From fdaa36c9fd4d0e86988f519fe2db283fa30bff60 Mon Sep 17 00:00:00 2001 From: Nonpawit Teerachetmongkol Date: Fri, 6 Nov 2020 00:03:16 +0700 Subject: [PATCH] fix: gist not support username contains numbers (#1622) --- app/embeds/Gist.js | 2 +- app/embeds/Gist.test.js | 6 ++++++ 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/app/embeds/Gist.js b/app/embeds/Gist.js index 3dab38639..177c4eecc 100644 --- a/app/embeds/Gist.js +++ b/app/embeds/Gist.js @@ -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 = {| diff --git a/app/embeds/Gist.test.js b/app/embeds/Gist.test.js index da0669a05..f625c8492 100644 --- a/app/embeds/Gist.test.js +++ b/app/embeds/Gist.test.js @@ -9,6 +9,12 @@ describe("Gist", () => { match ) ).toBeTruthy(); + + expect( + "https://gist.github.com/n3n/eb51ada6308b539d388c8ff97711adfa".match( + match + ) + ).toBeTruthy(); }); test("to not be enabled elsewhere", () => {