vscode-markdown icon indicating copy to clipboard operation
vscode-markdown copied to clipboard

Ability to handle file:// URI schema links as external websites

Open evx73 opened this issue 4 years ago • 5 comments

What is the problem?

Between other uses, I use VSCode as a personal wiki to note down various local system configurations, document path locations, etc.

I would to use links of the form file:// to local directories and files so that I can then click them and open them in an external application (e.g. Windows Explorer or Internet Explorer).

Unfortunately it seems that file URI schema URLs are disabled, I guess for security reasons. Is it possible to add a configuration parameter to enable them as external website links?

How can I reproduce it?

HTML [here](https://goodle.com)
FILE [here](file://c:/)

Using the markdown preview, the first link opens ok, the second link does not open when clicked.

Is there any error message in the console?

No message.

evx73 avatar May 17 '20 09:05 evx73

Thanks for the feedback.

This is controlled by VSCode itself (and it is disabled for security reasons as you guessed). You can open an issue there.

I am not sure how you organize your personal wiki. But probably you can export the Markdown files to HTML and the links should work as expected in a browser (#667).

yzhang-gh avatar May 17 '20 10:05 yzhang-gh

Thanks for the quick feedback. I will raise a feature request against VSCode itself and then link it here.

I normally (pre)view the markdown documents directly within VSCode. In any case, I tried to export the markdown document to HTML, but links export as plain text.

For example the following [file](file://C:/tmp) is exported to [file](file://C:/tmp) as plain HTML text.

evx73 avatar May 17 '20 14:05 evx73

I too have the same problem. I like to keep my notes organized in a markdown file and preview within vscode side by side with whatever project I'm working on. It would be really slick if I could link files like .docx in my markdown and click it within vscode and have the appropriate application opened to handle the file. There are also other interesting application URI's that would be really cool to use like ibooks: to link reference books, or notes: for open the note externally on my mac. Were you able to come up with any reasonable solutions? I had thought about using html instead, but that is just less convenient to edit and preview then markdown.

trojanpony avatar Aug 27 '22 17:08 trojanpony

Until now the handling of file links is still done by VS Code itself. I think it is a valid feature request, but it may be better to report it to VS Code.

yzhang-gh avatar Aug 27 '22 18:08 yzhang-gh

https://github.com/yzhang-gh/vscode-markdown/issues/688#issuecomment-1229240520

@yzhang-gh, I've filed https://github.com/microsoft/vscode/issues/213408#issue-2315895926.

RokeJulianLockhart avatar May 24 '24 17:05 RokeJulianLockhart