don't over-encode, do try to decode, fixes #85521

This commit is contained in:
Johannes Rieken
2019-11-25 16:58:47 +01:00
parent 16d4625715
commit 9227460df4
2 changed files with 18 additions and 6 deletions

View File

@@ -289,16 +289,23 @@ export namespace MarkdownString {
if (!data) {
return part;
}
let changed = false;
data = cloneAndChange(data, value => {
if (URI.isUri(value)) {
const key = `__uri_${Math.random().toString(16).slice(2, 8)}`;
bucket[key] = value;
changed = true;
return key;
} else {
return undefined;
}
});
return encodeURIComponent(JSON.stringify(data));
if (!changed) {
return part;
}
return JSON.stringify(data);
}
export function to(value: htmlContent.IMarkdownString): vscode.MarkdownString {