Skip to content

Commit

Permalink
Merge pull request #115 from DenverCoder544/api_doc_description_issue
Browse files Browse the repository at this point in the history
omit description if not found after the first heading
  • Loading branch information
ZakarFin authored Sep 4, 2024
2 parents 9c69b68 + fc85305 commit d1bdcb1
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion scripts/generateApidocs.js
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,10 @@ function getMdDesc(fileContent) {
// reads text after the first heading in md file and stops at either line change or EOF
const match = fileContent.match(/#\s+(.*)\r?\n\r?\n([^]*?)(?=\r?\n\r?\n|$)/);
if (match && match.length > 1) {
return match[2];
// if the content that follows after the first heading if another heading, just return empty (=there is no paragraph marking the short description)
if (!match[2].startsWith('#')) {
return match[2];
}
}

return '';
Expand Down

0 comments on commit d1bdcb1

Please sign in to comment.