notebook
notebook copied to clipboard
Unable to hyperlink to current folder
Description
In a markdown cell, whenever we attempt to hyperlink [current directory](./)
to show the contents of the current directory like this:
I get this error:
Reproduce
- Go to a markdown cell
- Type in
[current directory](./)
- Click on link
Expected behavior
The hyperlink should display:
the contents of the current directory.
Context
- Operating System and version:
- Browser and version:
- JupyterLab version:
Troubleshoot Output
Paste the output from running `jupyter troubleshoot` from the command line here. You may want to sanitize the paths in the output.
Command Line Output
Paste the output from your command line running `jupyter lab` here, use `--debug` if possible.
Browser Output
Paste the output from your browser Javascript console here, if applicable.
Thank you for opening your first issue in this project! Engagement like this is essential for open source projects! :hugs:
If you haven't done so already, check out Jupyter's Code of Conduct. Also, please try to follow the issue template as it helps other other community members to contribute more effectively.
You can meet the other Jovyans by joining our Discourse forum. There is also an intro thread there where you can stop by and say Hi! :wave:
Welcome to the Jupyter community! :tada:
Checking the behavior with the latest Notebook 7 pre-release (currently 7.0.0a13
).
Linking to the current directory does not show the error dialog anymore, but it also doesn't open the folder in a new browser tab:
https://user-images.githubusercontent.com/591645/220569136-69a90ef7-a4e0-47ca-b6a9-67b841db2f91.mp4
Linking to another directory tries to open the directory under /edit
:
https://user-images.githubusercontent.com/591645/220569210-b7865717-4c4c-4fc4-87e7-0bb60c678bf9.mp4
Digging a bit into this, JupyterLab handles local links via the CommandLinker
in this plugin:
https://github.com/jupyterlab/jupyterlab/blob/eeaa6505f658f7eaaad18ea2d7f15c3c5da0b23a/packages/rendermime-extension/src/index.ts#L66-L90
[](./)
is treated as "path": ""
which then does nothing because of this check: https://github.com/jupyterlab/jupyterlab/blob/eeaa6505f658f7eaaad18ea2d7f15c3c5da0b23a/packages/rendermime-extension/src/index.ts#L71
[](./folder)
then tries to open folder
via the document manager