microsoft / vscode

Visual Studio Code
https://code.visualstudio.com
MIT License
162.43k stars 28.62k forks source link

Markdown text referring to markdown filetypes wrongly generates unsafe links in markdown preview #121309

Closed rnickle closed 3 years ago

rnickle commented 3 years ago

Steps to Reproduce:

1.Open a new file and give it an '.md' extension (example, save-as X.md) 2.Ctrl-K V to "open a preview to the side" 3.Type XYZZY.md or README.md or TEST.md and preview will generate links to http://XYZZY.md, http://README.md and http://TEST.md respectively.

Version 1.55.2 (user setup)

Does this issue occur when all extensions are disabled?: Yes, I ran it with code --disable-extensions.

image

Took another screenshot to more strongly indicate that other 'file-like' text is not interpreted as links:

image

mjbvz commented 3 years ago

This is the markdown linkifier:

https://markdown-it.github.io/#md3=%7B%22source%22%3A%22README.md%22%2C%22defaults%22%3A%7B%22html%22%3Afalse%2C%22xhtmlOut%22%3Afalse%2C%22breaks%22%3Afalse%2C%22langPrefix%22%3A%22language-%22%2C%22linkify%22%3Atrue%2C%22typographer%22%3Atrue%2C%22_highlight%22%3Atrue%2C%22_strict%22%3Afalse%2C%22_view%22%3A%22html%22%7D%7D

You can disable markdown.preview.linkify if it is causing problems