From abf95a76db6689e0cfab10d9d088af0db04a330e Mon Sep 17 00:00:00 2001 From: Kerwin Bryant Date: Tue, 14 Jan 2025 03:38:14 +0000 Subject: [PATCH] fix --- web_src/js/features/repo-view-file-tree-sidebar.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/web_src/js/features/repo-view-file-tree-sidebar.ts b/web_src/js/features/repo-view-file-tree-sidebar.ts index de65dcc517016..1294da3030443 100644 --- a/web_src/js/features/repo-view-file-tree-sidebar.ts +++ b/web_src/js/features/repo-view-file-tree-sidebar.ts @@ -111,12 +111,12 @@ function extractPath(url) { const path = urlObj.pathname; // Define a regular expression to match "/{param1}/{param2}/src/{branch}/{main}/" - const regex = /^\/[^\/]+\/[^\/]+\/src\/[^\/]+\/[^\/]+\//; + const regex = /^\/[^/]+\/[^/]+\/src\/[^/]+\/[^/]+\//; // Use RegExp#exec() method to match the path const match = regex.exec(path); if (match) { - return path.substring(match[0].length); + return path.substring(match[0].length); } // If the path does not match, return the original path