Skip to content

Commit

Permalink
Don't render images in comments panel, fixes microsoft/vscode-pull-re…
Browse files Browse the repository at this point in the history
  • Loading branch information
Rachel Macfarlane committed Aug 23, 2018
1 parent 3933e6b commit 98a9c25
Showing 1 changed file with 9 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
*--------------------------------------------------------------------------------------------*/

import * as dom from 'vs/base/browser/dom';
import * as nls from 'vs/nls';
import { renderMarkdown } from 'vs/base/browser/htmlContentRenderer';
import { onUnexpectedError } from 'vs/base/common/errors';
import { Disposable } from 'vs/base/common/lifecycle';
Expand Down Expand Up @@ -156,6 +157,14 @@ export class CommentsModelRenderer implements ITreeRenderer {
}
});

const images = renderedComment.getElementsByTagName('img');
for (let i = 0; i < images.length; i++) {
const image = images[i];
const textDescription = dom.$('');
textDescription.textContent = image.alt ? nls.localize('imageWithLabel', "Image: {0}", image.alt) : nls.localize('image', "Image");
image.parentNode.replaceChild(textDescription, image);
}

templateData.commentText.appendChild(renderedComment);
}
}
Expand Down

0 comments on commit 98a9c25

Please sign in to comment.