With `md.supportHtml = true` and VS Code Remote SSH, a single img tag on compleition items cannot be loaded
#137,632 opened on Nov 22, 2021
Repository metrics
- Stars
- (74,848 stars)
- PR merge metrics
- (Avg merge 11h 43m) (1,000 merged PRs in 30d)
Description
Version: 1.63.0-insider (Universal) Commit: bedf867b5b02c1c800fbaf4d6ce09cefbafa1592 Date: 2021-11-18T05:17:00.890Z Electron: 13.5.2 Chromium: 91.0.4472.164 Node.js: 14.16.0 V8: 9.1.269.39-electron.0 OS: Darwin arm64 20.6.0
Related to #136027
With md.supportHtml = true and VS Code Remote SSH, a single img tag on compleition items cannot be loaded. If we write the img tag and markdown images in the same item, the img tag can be loaded.
Steps to Reproduce:
- Open a remote workspace with VS Code Remote SSH
- Execute https://github.com/tamuratak/vscode-extension-samples/tree/supporthtml_img_local_2/completions-sample
- Execute
Trigger Suggest - The image cannot be loaded.

If I replace the markdown with 1 <img src="${pngPathUriString}"> 2 , then the images can be loaded.

import * as vscode from 'vscode';
import * as path from 'path';
export function activate(context: vscode.ExtensionContext) {
const provider1 = vscode.languages.registerCompletionItemProvider('plaintext', {
provideCompletionItems(document: vscode.TextDocument, position: vscode.Position, token: vscode.CancellationToken, context: vscode.CompletionContext) {
const pngPath = path.join(__dirname, '..', 'a.png')
const pngPathUriString = vscode.Uri.file(pngPath).toString()
const snippetCompletion = new vscode.CompletionItem('Good part of the day');
snippetCompletion.insertText = new vscode.SnippetString('Good ${1|morning,afternoon,evening|}. It is ${1}, right?');
const md = new vscode.MarkdownString(`1 <img src="${pngPathUriString}">`);
md.supportHtml = true
snippetCompletion.documentation = md
// return all completion items as array
return [
snippetCompletion
];
}
});
context.subscriptions.push(provider1);
}