From c38a095ea5b8d76d1c1657a244cc0d1c33361065 Mon Sep 17 00:00:00 2001 From: tgreyuk Date: Sun, 9 Jan 2022 16:22:49 +0000 Subject: [PATCH] fix: Add comments for function type properties (#281) --- .../src/resources/helpers/property-table.ts | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/packages/typedoc-plugin-markdown/src/resources/helpers/property-table.ts b/packages/typedoc-plugin-markdown/src/resources/helpers/property-table.ts index ec08ca124..b674d9940 100644 --- a/packages/typedoc-plugin-markdown/src/resources/helpers/property-table.ts +++ b/packages/typedoc-plugin-markdown/src/resources/helpers/property-table.ts @@ -61,11 +61,10 @@ export default function () { ); if (hasComments) { - if (property.comment) { + const comments = getComments(property); + if (comments) { row.push( - stripLineBreaks( - Handlebars.helpers.comments.call(property.comment), - ), + stripLineBreaks(Handlebars.helpers.comments.call(comments)), ); } else { row.push('-'); @@ -112,3 +111,10 @@ function getName(property: DeclarationReflection) { } return md.join(''); } + +function getComments(property: DeclarationReflection) { + if (property.signatures) { + return property.signatures[0].comment; + } + return property.comment; +}