mirror of
https://github.com/microsoft/vscode.git
synced 2026-04-27 12:04:04 +01:00
improve image source extraction for remote cases, https://github.com/kisstkondoros/gutter-preview/issues/57
This commit is contained in:
@@ -237,8 +237,7 @@ export namespace MarkdownString {
|
||||
const resUris: { [href: string]: UriComponents } = Object.create(null);
|
||||
res.uris = resUris;
|
||||
|
||||
const renderer = new marked.Renderer();
|
||||
renderer.image = renderer.link = (href: string): string => {
|
||||
const collectUri = (href: string): string => {
|
||||
try {
|
||||
let uri = URI.parse(href, true);
|
||||
uri = uri.with({ query: _uriMassage(uri.query, resUris) });
|
||||
@@ -248,6 +247,10 @@ export namespace MarkdownString {
|
||||
}
|
||||
return '';
|
||||
};
|
||||
const renderer = new marked.Renderer();
|
||||
renderer.link = collectUri;
|
||||
renderer.image = href => collectUri(htmlContent.parseHrefAndDimensions(href).href);
|
||||
|
||||
marked(res.value, { renderer });
|
||||
|
||||
return res;
|
||||
|
||||
Reference in New Issue
Block a user