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

Support relative paths for images in markdown/rich output cells (of untitled notebooks) #99139

Closed
DonJayamanne opened this issue Jun 2, 2020 · 4 comments
Assignees
Labels
notebook under-discussion Issue is under discussion for relevance, priority, approach
Milestone

Comments

@DonJayamanne
Copy link
Contributor

DonJayamanne commented Jun 2, 2020

  • Version: 1.46.0-insider
  • Commit: 1bfa086
  • Date: 2020-06-02T08:10:00.819Z
  • Electron: 7.3.0
  • Chrome: 78.0.3904.130
  • Node.js: 12.8.1
  • V8: 7.8.279.23-electron.0
  • OS: Darwin x64 19.5.0

Steps to Reproduce:

  1. Create an untitled notebook, markdown with relative images do not work.
  2. Expectation is images will be resolved relative to current workspace folder
    However in a multi-root workspace, things might be a little bit more complicated.

Not sure how VSC handles this today, e.g. with auto completion for relative imports in untitled js/ts files.

I'd also this to work with HTML output of cells (can create a separate issue, assumed they are similar)

Does this issue occur when all extensions are disabled?: Yes

@rebornix /cc

@DonJayamanne DonJayamanne changed the title Support relative paths for images in markdown cells (of untitled notebooks) Support relative paths for images in markdown/rich output cells (of untitled notebooks) Jun 2, 2020
@rebornix
Copy link
Member

rebornix commented Jun 5, 2020

This is also tricky with single workspace as the relative path might be broken once you save it to disk.

@rebornix rebornix added notebook under-discussion Issue is under discussion for relevance, priority, approach labels Jun 5, 2020
@rebornix rebornix added this to the June 2020 milestone Jun 5, 2020
@roblourens
Copy link
Member

roblourens commented Jun 5, 2020

Doesn't work in the normal markdown preview either. I dunno if it's worth it really. You might have images that work in an untitled file, then go and save the file to some subfolder and then the images don't work anymore.

@DonJayamanne
Copy link
Contributor Author

DonJayamanne commented Jun 5, 2020

Agreed.
However as Jupyter notebook user, when they create untitled files, relative images work in markdown & html output.

When using the WebView panel, we just change the base href in html document to point to the local workspace and that's how relative images work for markdown/html.

  • If we were to create physical files, then this kind of defeats the purpose of the notion of untitled files.
  • If we did create physical files that had a scheme of untitled would that work with the VS Code API (i.e. actual file but untitled scheme). I know VS Code custom editor has issues with such a combination. Also this is not how our extension works today with untitled files (we don't create physical files)

I'm trying to understand how we make this possible with the new VS Code API.

@roblourens
Copy link
Member

This seems to work now

@github-actions github-actions bot locked and limited conversation to collaborators Feb 5, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
notebook under-discussion Issue is under discussion for relevance, priority, approach
Projects
None yet
Development

No branches or pull requests

3 participants