Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Anchor hrefs in jupyter output are not working #153032

Closed
janhurst opened this issue Jun 15, 2022 · 5 comments · Fixed by #157575
Closed

Anchor hrefs in jupyter output are not working #153032

janhurst opened this issue Jun 15, 2022 · 5 comments · Fixed by #157575
Assignees
Labels
insiders-released Patch has been released in VS Code Insiders notebook-output under-discussion Issue is under discussion for relevance, priority, approach verification-needed Verification of issue is requested verified Verification succeeded
Milestone

Comments

@janhurst
Copy link

janhurst commented Jun 15, 2022

The very useful ipytree Jupyter Widget does not function inside the vscode notebook editor.
When clicking on a node in the tree, a model dialog is popped up, which looks like is responding to an attempt to open a editor window that is associated with the node content or some part of the underlying HTML attached to the node.

image

The same code in a Jupyter Lab web instance functions as expected.

This issue is mentioned in the ipytree Github here

Environment data

  • VS Code version: 1.68
  • Jupyter Extension version (available under the Extensions sidebar): v2022.5.1001601848
  • Python Extension version (available under the Extensions sidebar): v2022.8.0
  • OS (Windows | Mac | Linux distro) and version: Windows
  • Python and/or Anaconda version: various, 3.10
  • Type of virtual environment used (N/A | venv | virtualenv | conda | ...): conda
  • Jupyter server running: Local

Expected behaviour

Click on ipytree node and UI updates with any attach callback firing

Actual behaviour

Model popup error
image

Steps to reproduce:

Following instructions on https://github.com/QuantStack/ipytree

conda install -c conda-forge ipytree

run example code eg:

from ipytree import Tree, Node
tree = Tree(stripes=True)
node1 = Node('node1')
tree.add_node(node1)
tree

And then click on the node

@janhurst janhurst added the bug Issue identified by VS Code Team member as probable bug label Jun 15, 2022
@rchiodo
Copy link
Contributor

rchiodo commented Jun 15, 2022

Thanks for the issue. I believe QuantStack would likely have to fix this. I think they're opening a URL that doesn't exist.

@janhurst
Copy link
Author

It feels a bit odd for this to be on the QuantStack side... it seems like the Jupyter render is seeing a button click on a node as needing to open a URL, when in native Jupyter Lab it instead fires a javascript call.

@DonJayamanne
Copy link
Contributor

@rchiodo I think this is a problem with the handling of anchor tags #, the core web view code seems to be treating this as a file link (hence the error message).
This issue might have to be moved to vscode repo.

Repro steps: Run a cell with the following code in Jupyter (or generate an output that contains the same output)

%%html
<a href="#">Hello</a>

@mjbvz might have some idea what needs to be done here.

@rchiodo rchiodo transferred this issue from microsoft/vscode-jupyter Jun 23, 2022
@rchiodo
Copy link
Contributor

rchiodo commented Jun 23, 2022

This can repro without using ipytree. Just use the example that Don provided.

@vscodenpa
Copy link

Thanks for creating this issue! It looks like you may be using an old version of VS Code, the latest stable release is 1.68.1. Please try upgrading to the latest version and checking whether this issue remains.

Happy Coding!

@rchiodo rchiodo changed the title ipytree Jupyter Widget not working in notebook editor Anchor hrefs in jupyter output are not working Jun 23, 2022
@rchiodo rchiodo removed their assignment Jun 23, 2022
@rchiodo rchiodo added notebook-output and removed bug Issue identified by VS Code Team member as probable bug triage-needed labels Jun 23, 2022
@rebornix rebornix added the under-discussion Issue is under discussion for relevance, priority, approach label Jun 27, 2022
@rebornix rebornix added this to the July 2022 milestone Jun 27, 2022
@mjbvz mjbvz modified the milestones: July 2022, August 2022 Jul 25, 2022
@vscodenpa vscodenpa added the unreleased Patch has not yet been released in VS Code Insiders label Aug 8, 2022
andreamah pushed a commit that referenced this issue Aug 9, 2022
Fixes #153032

This fixes our handling of `href="#"` on links in notebooks
@vscodenpa vscodenpa added insiders-released Patch has been released in VS Code Insiders and removed unreleased Patch has not yet been released in VS Code Insiders labels Aug 9, 2022
joyceerhl pushed a commit that referenced this issue Aug 10, 2022
Fixes #153032

This fixes our handling of `href="#"` on links in notebooks
@mjbvz mjbvz added the verification-needed Verification of issue is requested label Aug 23, 2022
@rzhao271 rzhao271 added the verified Verification succeeded label Aug 26, 2022
@github-actions github-actions bot locked and limited conversation to collaborators Sep 25, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
insiders-released Patch has been released in VS Code Insiders notebook-output under-discussion Issue is under discussion for relevance, priority, approach verification-needed Verification of issue is requested verified Verification succeeded
Projects
None yet
Development

Successfully merging a pull request may close this issue.

7 participants