Fix what an empty string is, don't render empty MarkdownString, #29076

This commit is contained in:
Johannes Rieken
2017-08-24 16:49:21 +02:00
parent fb83608ebc
commit 57da808a98
2 changed files with 4 additions and 4 deletions

View File

@@ -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;
}
}