Skip to content

Support Local File Links from the Markdown Preview - #18824

Merged
Matt Bierner (mjbvz) merged 4 commits into
microsoft:masterfrom
mjbvz:markdown-preview-support-file-links
Jan 20, 2017
Merged

Matt Bierner (mjbvz) merged 4 commits into
microsoft:masterfrom
mjbvz:markdown-preview-support-file-links

Conversation

@mjbvz

@mjbvz Matt Bierner (mjbvz) commented Jan 20, 2017 •

Copy link
Copy Markdown
Contributor

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
Matt Bierner (mjbvz) merged commit d85dc99 into microsoft:master Jan 20, 2017
@mjbvz Matt Bierner (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