Skip to content

Commit 10cd31b

Browse files
committed
fix(core): resolve incorrect anchor warning messages
1 parent c10d74b commit 10cd31b

File tree

2 files changed

+11
-8
lines changed

2 files changed

+11
-8
lines changed

.changeset/wild-nights-return.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
---
2+
'typedoc-plugin-markdown': patch
3+
---
4+
5+
- Resolve "does not have an anchor but one was requested" warnings in verbose log mode (#850).
6+
- Guard against undefined types causing errors in complex types in tables (thanks @ilyabo).

packages/typedoc-plugin-markdown/src/theme/context/partials/member.container.ts

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -8,15 +8,12 @@ export function memberContainer(
88
options: { headingLevel: number; nested?: boolean; groupTitle?: string },
99
): string {
1010
const md: string[] = [];
11-
const anchor = this.router.hasUrl(model)
12-
? this.router.getAnchor(model)
13-
: undefined;
11+
const anchor =
12+
!this.router.hasOwnDocument(model) && this.router.hasUrl(model)
13+
? this.router.getAnchor(model)
14+
: undefined;
1415

15-
if (
16-
!this.router.hasOwnDocument(model) &&
17-
anchor &&
18-
this.options.getValue('useHTMLAnchors')
19-
) {
16+
if (anchor && this.options.getValue('useHTMLAnchors')) {
2017
md.push(`<a id="${anchor}"></a>`);
2118
}
2219

0 commit comments

Comments
 (0)