diff --git a/packages/application-extension/src/index.ts b/packages/application-extension/src/index.ts index 669721f32a..01d8a1c07b 100644 --- a/packages/application-extension/src/index.ts +++ b/packages/application-extension/src/index.ts @@ -200,7 +200,8 @@ const opener: JupyterFrontEndPlugin = { ): void => { const { commands, docRegistry } = app; - const ignoredPattern = new RegExp('/tree(.*)'); + const ignoredPattern = new RegExp('/tree/(.*)'); + const pathSegmentPattern = new RegExp('\\bnotebooks\\b|\\bedit\\b'); const command = 'router:tree'; commands.addCommand(command, { execute: (args: any) => { @@ -212,7 +213,7 @@ const opener: JupyterFrontEndPlugin = { return; } - const pathSegments: string[] = parsed.path.split(TREE_PATTERN); + const pathSegments: string[] = parsed.path.split(pathSegmentPattern); if (pathSegments.length > 1 && pathSegments[0].match(ignoredPattern)) { return; }