mirror of
https://github.com/microsoft/vscode.git
synced 2026-04-27 03:54:24 +01:00
Fix what an empty string is, don't render empty MarkdownString, #29076
This commit is contained in:
@@ -17,7 +17,7 @@ export class MarkdownString implements IMarkdownString {
|
||||
|
||||
static isEmpty(oneOrMany: IMarkdownString | IMarkdownString[]): boolean {
|
||||
if (MarkdownString.isMarkdownString(oneOrMany)) {
|
||||
return Boolean(oneOrMany.value);
|
||||
return !oneOrMany.value;
|
||||
} else if (Array.isArray(oneOrMany)) {
|
||||
return oneOrMany.every(MarkdownString.isEmpty);
|
||||
} else {
|
||||
@@ -49,11 +49,11 @@ export class MarkdownString implements IMarkdownString {
|
||||
}
|
||||
|
||||
appendCodeblock(langId: string, code: string): this {
|
||||
this.value += '```';
|
||||
this.value += '\n```';
|
||||
this.value += langId;
|
||||
this.value += '\n';
|
||||
this.value += code;
|
||||
this.value += '```\n';
|
||||
this.value += '\n```\n';
|
||||
return this;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user