Skip to content

Commit

Permalink
Handle empty metadata keys when migrating markdown
Browse files Browse the repository at this point in the history
  • Loading branch information
bherr2 committed Dec 8, 2023
1 parent 432e517 commit e763611
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/migration/ccf-releases/md-parser.js
Original file line number Diff line number Diff line change
Expand Up @@ -34,10 +34,10 @@ export class HraMarkdownParser {
}

hasKey(key) {
return !!this.rawMd.find((l) => l.includes(`**${key}:**`));
return !!this.rawMd.find((l) => l.includes(`**${key}:**`)) && this.getMetadata(key)?.trim().length > 0;
}
getMetadata(key) {
if (!this.hasKey(key)) {
if (!this.rawMd.find((l) => l.includes(`**${key}:**`))) {
return '';
}
return this.rawMd
Expand Down

0 comments on commit e763611

Please sign in to comment.