From 2a775aa304b6635d97de773039babf8bd7de5db6 Mon Sep 17 00:00:00 2001 From: Jason Weill Date: Wed, 1 Dec 2021 15:36:26 -0800 Subject: [PATCH] Strips extension from initial heading as well as updated heading --- packages/application-extension/src/index.ts | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/packages/application-extension/src/index.ts b/packages/application-extension/src/index.ts index 8f1f461a6..0db285ff4 100644 --- a/packages/application-extension/src/index.ts +++ b/packages/application-extension/src/index.ts @@ -434,8 +434,11 @@ const title: JupyterFrontEndPlugin = { return; } + // Don't show the file extension for .ipynb files. + const stripIpynb = /\.ipynb$/; + const h = document.createElement('h1'); - h.textContent = current.title.label; + h.textContent = current.title.label.replace(stripIpynb, ''); widget.node.appendChild(h); widget.node.style.marginLeft = '10px'; if (!docManager) { @@ -468,8 +471,6 @@ const title: JupyterFrontEndPlugin = { const newPath = current.context.path ?? result.path; const basename = PathExt.basename(newPath); - // Don't show the file extension for .ipynb files. - const stripIpynb = /\.ipynb$/; h.textContent = basename.replace(stripIpynb, ''); if (!router) {