From d5cd214506307cac5df3b2368b7e7aa8e19325ef Mon Sep 17 00:00:00 2001 From: Fabio Salvalai Date: Wed, 28 Aug 2024 14:40:48 +0200 Subject: [PATCH 1/2] change regex to exclude '-' as repo --- src/contextmenu.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/contextmenu.js b/src/contextmenu.js index c6bb328..65ce26d 100644 --- a/src/contextmenu.js +++ b/src/contextmenu.js @@ -89,7 +89,7 @@ function parseLink(linkUrl, selectionText, pageUrl) { }; } - const pathRegexp = /.+\/([^/]+)\/(blob|tree)\/[^/]+\/(.*)/; + const pathRegexp = /.+\/([^\/-][^\/]*)\/(?:-\/)?(tree|blob)\/[^\/]+\/(.*)/; if (!pathRegexp.test(path)) { throw new Error(`Invalid link. Could not extract info from: ${path}.`); From 0887b55fd84cdc92b27b4585d8ad463b53abf04e Mon Sep 17 00:00:00 2001 From: Fabio Salvalai Date: Wed, 28 Aug 2024 15:38:56 +0200 Subject: [PATCH 2/2] in a merge request : click the 3 vertical dots, right click view file and open in vscode --- src/contextmenu.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/contextmenu.js b/src/contextmenu.js index 65ce26d..e539f7d 100644 --- a/src/contextmenu.js +++ b/src/contextmenu.js @@ -1,4 +1,4 @@ -const PULL_REQUEST_PATH_REGEXP = /.+\/([^/]+)\/(pull)\/[^/]+\/(.*)/; +const PULL_REQUEST_PATH_REGEXP = /.+\/([^\/-][^\/]*)\/(?:-\/)?(pull|merge_requests)\/[^\/]+\/(.*)/; class OptionValidationError extends Error { constructor(message) {