Skip to content

Commit 06bd81d

Browse files
committed
fix: Fix backlink error when filenames contain regex symbols
1 parent ee66fe6 commit 06bd81d

File tree

1 file changed

+1
-3
lines changed

1 file changed

+1
-3
lines changed

src/features/BacklinksTreeDataProvider.ts

+1-3
Original file line numberDiff line numberDiff line change
@@ -104,9 +104,7 @@ export default class BacklinksTreeDataProvider implements vscode.TreeDataProvide
104104
collapsibleState,
105105
);
106106
backlink.description = `(${referencesByPath[pathParam].length}) ${trimSlashes(
107-
pathParam
108-
.replace(workspaceFolder.uri.fsPath, '')
109-
.replace(new RegExp(`${path.basename(pathParam)}$`), ''),
107+
pathParam.replace(workspaceFolder.uri.fsPath, '').replace(path.basename(pathParam), ''),
110108
)}`;
111109
backlink.tooltip = pathParam;
112110
backlink.command = {

0 commit comments

Comments
 (0)