microsoft/vscode

MarkdownString cannot render webp image

Sean10 opened this issue · 5 comments

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

  • VS Code Version: 1.64.0
  • OS Version: mac 10.15.7

Steps to Reproduce:

  1. preview this file
const md = new vscode.MarkdownString('![](./leveldb2.webp)')
  1. not work.

Maybe adding the suffix here could solve this problem?

private readonly validExtensions = new Set(['.svg', '.png', '.jpg', '.jpeg', '.gif', '.bmp']);
mjbvz commented

Do they render in other places in vscode, such as the markdown preview?

Do they render in other places in vscode, such as the markdown preview?

In yzhang-gh/vscode-markdown: Markdown All in One, it could work. webp is rendered correctly.

Maybe my usage is wrong. I will try it.

Do they render in other places in vscode, such as the markdown preview?

command markdown.showPreview use MarkdownIt to render the image, while MarkdownString use the different ways to render image.

But MarkdownString is the exposed API, can you support this ?

/verified