提交 6dae5a3b 编写于 作者: M Matt Bierner

Fix rendering of whitespace in markdown parameter hinds

Fixes #48758
上级 c94f12ed
......@@ -48,7 +48,7 @@
white-space: pre-wrap;
}
.monaco-editor .parameter-hints-widget .docs.markdown-docs {
.monaco-editor .parameter-hints-widget .docs .markdown-docs {
white-space: initial;
}
......
......@@ -359,15 +359,15 @@ export class ParameterHintsWidget implements IContentWidget, IDisposable {
this.renderDisposeables = [];
const activeParameter = signature.parameters[this.hints.activeParameter];
dom.removeClass(this.docs, 'markdown-docs');
if (activeParameter && activeParameter.documentation) {
const documentation = $('span.documentation');
if (typeof activeParameter.documentation === 'string') {
dom.removeClass(this.docs, 'markdown-docs');
documentation.textContent = activeParameter.documentation;
} else {
dom.addClass(this.docs, 'markdown-docs');
const renderedContents = this.markdownRenderer.render(activeParameter.documentation);
dom.addClass(renderedContents.element, 'markdown-docs');
this.renderDisposeables.push(renderedContents);
documentation.appendChild(renderedContents.element);
}
......@@ -380,6 +380,7 @@ export class ParameterHintsWidget implements IContentWidget, IDisposable {
dom.append(this.docs, $('p', null, signature.documentation));
} else {
const renderedContents = this.markdownRenderer.render(signature.documentation);
dom.addClass(renderedContents.element, 'markdown-docs');
this.renderDisposeables.push(renderedContents);
dom.append(this.docs, renderedContents.element);
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册