Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
  • Loading branch information
kerwin612 committed Jan 14, 2025
1 parent 9400d52 commit abf95a7
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions web_src/js/features/repo-view-file-tree-sidebar.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit abf95a7

Please sign in to comment.