From a4596bf033d939bebee8174ef2609ac0cddeeb3a Mon Sep 17 00:00:00 2001 From: Wiktor Walasek Date: Thu, 23 Jan 2020 11:29:59 +0100 Subject: [PATCH] And one more cr fix as I restored old lines badly --- jsdoc_parser.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/jsdoc_parser.js b/jsdoc_parser.js index 8a5f686..b841cd9 100644 --- a/jsdoc_parser.js +++ b/jsdoc_parser.js @@ -46,7 +46,7 @@ const tagSynonyms = { * @return {String} */ function formatDescription(text, insertDot) { - text = text.trim() + text = text ? text.trim() : '' if (!text) return '' text = text.replace(/\s\s+/g, ' ') // Avoid multiple spaces text = text.replace(/\n/g, ' ') // Make single line @@ -129,7 +129,7 @@ function jsdocParser(text, parsers, options) { } } - if (tag.description && ['description', 'param', 'return', 'todo'].includes(tag.title)) + if (['description', 'param', 'return', 'todo'].includes(tag.title)) tag.description = formatDescription(tag.description, options.jsdocAddDotToDescription) if (!tag.description && ['description', 'param', 'return', 'todo', 'memberof'].includes(tag.title) && -- GitLab