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 Local File Links from the Markdown Preview #18824

Merged
merged 4 commits into from
Jan 20, 2017

Conversation

mjbvz
Copy link
Collaborator

@mjbvz mjbvz commented Jan 20, 2017

Fixes #989

Bug

  • file:// links do not work in the markdown preview.
  • ./file.ext and /file.ext and file.ext links do not work in the markdown preview.

Fix
For the first issue, allow file:// links explicitly.

For the second, add a custom link normalizer. If the incoming link has no scheme, try to resolve it relative to the current file or workspace. Links like /file.ext are relative to the workspace, while links like file.ext or ./file.ext are relative to the current file.

Also did some refactoring to extract renderer to own file

Fixes microsoft#989

**Bug**

* `file://` links do not work in the markdown preview.
* `./file` and `/file` and `file` links do not work in the markdown preview.

**Fix**
For the first issue, allow `file://` links explicitly.

Add a custom link validator. If the incoming link has no scheme, try to resolve it relative to the current file or workspace. Likes like `/file` are relative to the workspace, while links like `file` or `./file` are relative to the current file.
@mjbvz mjbvz merged commit d85dc99 into microsoft:master Jan 20, 2017
@mjbvz mjbvz added this to the January 2017 milestone Jan 20, 2017
@github-actions github-actions bot locked and limited conversation to collaborators Mar 27, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Markdown: Allow to open files inside the editor that are linked from the markdown
2 participants