提交 f1e08f53 编写于 作者: J Johannes Rieken

crop suggest details length, and markdown value length so that UX doesn't...

crop suggest details length, and markdown value length so that UX doesn't freeze, fixes https://github.com/microsoft/vscode/issues/100949
上级 b0c81f44
......@@ -207,10 +207,13 @@ export function renderMarkdown(markdown: IMarkdownString, options: MarkdownRende
allowedSchemes.push(Schemas.command);
}
// values that are too long will freeze the UI
let value = markdown.value ?? '';
if (value.length > 100_000) {
value = `${value.substr(0, 100_000)}…`;
}
const renderedMarkdown = marked.parse(
markdown.supportThemeIcons
? markdownEscapeEscapedCodicons(markdown.value || '')
: (markdown.value || ''),
markdown.supportThemeIcons ? markdownEscapeEscapedCodicons(value) : value,
markedOptions
);
......
......@@ -380,7 +380,7 @@ class SuggestionDetails {
// --- details
if (detail) {
this.type.innerText = detail;
this.type.innerText = detail.length > 100_000 ? `${detail.substr(0, 100_000)}…` : detail;
show(this.type);
} else {
this.type.innerText = '';
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册