From 42fba942ee35e1280765c4803ddc687885ef27da Mon Sep 17 00:00:00 2001 From: Gerrit Birkeland Date: Sun, 18 Sep 2022 12:00:59 -0600 Subject: [PATCH] Fix double Type Parameters heading render Resolves #2054 --- CHANGELOG.md | 1 + .../output/themes/default/partials/member.declaration.tsx | 8 ++------ .../themes/default/partials/member.signature.body.tsx | 8 ++------ 3 files changed, 5 insertions(+), 12 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index a4464b0a9..c1b9b639d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -8,6 +8,7 @@ ### Bug Fixes - TypeDoc will now prefer comments on variable declarations over signature comments, #2042. +- Fixed double rendering of "Type Parameters" header, #2054. - Removed unused `widgets.png` and `widgets@2x.png` files from generated assets folder. ## v0.23.14 (2022-09-03) diff --git a/src/lib/output/themes/default/partials/member.declaration.tsx b/src/lib/output/themes/default/partials/member.declaration.tsx index da9dd70c2..97b27d17e 100644 --- a/src/lib/output/themes/default/partials/member.declaration.tsx +++ b/src/lib/output/themes/default/partials/member.declaration.tsx @@ -26,12 +26,8 @@ export const memberDeclaration = (context: DefaultThemeRenderContext, props: Dec {context.comment(props)} - {hasTypeParameters(props) && ( - <> -

Type Parameters

- {context.typeParameters(props.typeParameters)} - - )} + {hasTypeParameters(props) && context.typeParameters(props.typeParameters)} + {props.type instanceof ReflectionType && (

Type declaration

diff --git a/src/lib/output/themes/default/partials/member.signature.body.tsx b/src/lib/output/themes/default/partials/member.signature.body.tsx index 419f28f3a..576497d8d 100644 --- a/src/lib/output/themes/default/partials/member.signature.body.tsx +++ b/src/lib/output/themes/default/partials/member.signature.body.tsx @@ -12,12 +12,8 @@ export const memberSignatureBody = ( {renderFlags(props.flags, props.comment)} {context.comment(props)} - {hasTypeParameters(props) && ( -
-

Type Parameters

- {context.typeParameters(props.typeParameters)} -
- )} + {hasTypeParameters(props) && context.typeParameters(props.typeParameters)} + {props.parameters && props.parameters.length > 0 && (

Parameters