Skip to content

Commit

Permalink
fix(docgen): don't render description tags if no description is present
Browse files Browse the repository at this point in the history
  • Loading branch information
vhyrro committed Feb 3, 2023
1 parent 9074328 commit 64dc28d
Showing 1 changed file with 14 additions and 10 deletions.
24 changes: 14 additions & 10 deletions docgen/docgen.lua
Original file line number Diff line number Diff line change
Expand Up @@ -452,22 +452,26 @@ docgen.render = function(configuration_option)
"",
table.concat({ "<summary><code>", self.data.name, "</code></summary>" }),
"",
"<h6>",
"",
}

vim.list_extend(basis, self.comments)
vim.list_extend(basis, {
"",
"</h6>",
"",
table.concat({
if not vim.tbl_isempty(self.comments) then
vim.list_extend(basis, {
"<h6>",
"",
})
vim.list_extend(basis, self.comments)
vim.list_extend(basis, {
"</h6>",
"",
})
end

table.insert(basis, table.concat({
"Default Value:",
(type(self.object) == "number" or type(self.object) == "nil")
and table.concat({ " `", tostring(self.object), "`" })
or nil,
}),
})
}))
vim.list_extend(basis, docgen.htmlify(configuration_option))
vim.list_extend(basis, {
"",
Expand Down

0 comments on commit 64dc28d

Please sign in to comment.