提交 98a9c257 编写于 作者: R Rachel Macfarlane

Don't render images in comments panel, fixes...

Don't render images in comments panel, fixes https://github.com/Microsoft/vscode-pull-request-github/issues/214
上级 3933e6b0
......@@ -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';
......@@ -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);
}
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册