Fix bug in the markdown viewer
Fixes https://jira.coreos.com/browse/QUAY-840
This commit is contained in:
parent
32a473d23c
commit
3ebcc07fec
1 changed files with 2 additions and 3 deletions
|
@ -30,7 +30,7 @@ export class MarkdownViewComponent implements OnChanges {
|
|||
if (changes['content']) {
|
||||
if (!changes['content'].currentValue && this.placeholderNeeded) {
|
||||
this.convertedHTML = this.$sce.trustAsHtml(this.placeholder);
|
||||
} else if (this.firstLineOnly) {
|
||||
} else if (this.firstLineOnly && changes['content'].currentValue) {
|
||||
const firstLine: string = changes['content'].currentValue.split('\n')
|
||||
// Skip code lines
|
||||
.filter(line => line.indexOf(' ') != 0)
|
||||
|
@ -41,9 +41,8 @@ export class MarkdownViewComponent implements OnChanges {
|
|||
|
||||
this.convertedHTML = this.$sanitize(this.markdownConverter.makeHtml(firstLine));
|
||||
} else {
|
||||
this.convertedHTML = this.$sanitize(this.markdownConverter.makeHtml(changes['content'].currentValue));
|
||||
this.convertedHTML = this.$sanitize(this.markdownConverter.makeHtml(changes['content'].currentValue || ''));
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Reference in a new issue