Commit bc9d692a authored by Wiktor Walasek's avatar Wiktor Walasek

Fix custom spaces in desc without tag

parent 773df8af
......@@ -138,23 +138,19 @@ function jsdocParser(text, parsers, options) {
// Create final jsDoc string
.forEach((tag, tagIndex) => {
let tagString
if (tag.title !== 'description' || options.jsdocDescriptionTag)
tagString = ` * @${tag.title}`
else
tagString = ` *`
let useTagTitle = (tag.title !== 'description' || options.jsdocDescriptionTag)
let tagString = ` * `
if (useTagTitle) tagString += `@${tag.title}`
if (tag.type && tag.type.name) tagString += gap + `{${tag.type.name}}`
if (tag.name) tagString += gap + tag.name
// Add description (complicated because of text wrap)
if (tag.description && tag.title !== 'example') {
tagString += gap
if (['memberof', 'see'].includes(tag.title)) { // Avoid wrapping
tagString += tag.description
} else { // Wrap tag description
if (useTagTitle) tagString += gap
const marginLength = tagString.length
let maxWidth = printWidth
if (marginLength >= maxWidth) maxWidth = marginLength + 40
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment