From f2653c04cb35e59a1bb9270fdafe921b7481137b Mon Sep 17 00:00:00 2001 From: Sankt Petersbug <39347736+sankt-petersbug@users.noreply.github.com> Date: Mon, 22 Oct 2018 17:41:22 -0500 Subject: [PATCH] Fix Markdown Preview incorrectly encodes a link (#61530) For known external scheme, the customized normalizeLink method use vscode.Uri to parse and create the string representation of the link before caling the original normalizeLink method. The toString method of vscode.Uri encodes the result by default, and this is unecessary since encoding is handled by the original normalizeLink method. Calls toString method with skipEncoding option. Resolves: #60525 --- extensions/markdown-language-features/src/markdownEngine.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/extensions/markdown-language-features/src/markdownEngine.ts b/extensions/markdown-language-features/src/markdownEngine.ts index f381a0c0ae7..9bd90ead16a 100644 --- a/extensions/markdown-language-features/src/markdownEngine.ts +++ b/extensions/markdown-language-features/src/markdownEngine.ts @@ -181,7 +181,8 @@ export class MarkdownEngine { try { const externalSchemeUri = getUriForLinkWithKnownExternalScheme(link); if (externalSchemeUri) { - return normalizeLink(externalSchemeUri.toString()); + // set true to skip encoding + return normalizeLink(externalSchemeUri.toString(true)); } -- GitLab