浏览代码

use encodeURI instead of encodeURIComponent for shareable links (#5340)

tree URLs are documented as `/lab/tree/path/to/notebook.ipynb` not `/lab/tree/path%2Fto%2Fnotebook.ipynb`
Min RK 6 年之前
父节点
当前提交
c4a9a70d56
共有 2 个文件被更改,包括 2 次插入2 次删除
  1. 1 1
      packages/application-extension/src/index.tsx
  2. 1 1
      packages/filebrowser-extension/src/index.ts

+ 1 - 1
packages/application-extension/src/index.tsx

@@ -231,7 +231,7 @@ const tree: JupyterLabPlugin<void> = {
         const treeMatch = args.path.match(Patterns.tree);
         const workspaceMatch = args.path.match(Patterns.workspace);
         const match = treeMatch || workspaceMatch;
-        const path = decodeURIComponent(match[1]);
+        const path = decodeURI(match[1]);
         const { page, workspaces } = app.info.urls;
         const workspace = PathExt.basename(app.info.workspace);
         const url =

+ 1 - 1
packages/filebrowser-extension/src/index.ts

@@ -440,7 +440,7 @@ function addCommands(
 
   commands.addCommand(CommandIDs.share, {
     execute: () => {
-      const path = encodeURIComponent(browser.selectedItems().next().path);
+      const path = encodeURI(browser.selectedItems().next().path);
       const tree = PageConfig.getTreeUrl({ workspace: true });
 
       Clipboard.copyToSystem(URLExt.join(tree, path));