Skip to content

Commit 51b8f88

Browse files
committed
fix(core): fix missing segments in declaration titles that contain periods
1 parent 649dd41 commit 51b8f88

File tree

6 files changed

+12
-8
lines changed

6 files changed

+12
-8
lines changed

.changeset/many-worms-wear.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
'typedoc-plugin-markdown': patch
3+
---
4+
5+
- Fix missing segments in declaration titles that contain periods.

packages/typedoc-plugin-markdown/src/theme/context/helpers/get-flattened-declarations.ts

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,6 @@ export function getFlattenedDeclarations(
1111
const childObj = {
1212
...child,
1313
name: `${current.name}.${child.name}`,
14-
getFullName: () => `${current.getFullName()}`,
15-
getFriendlyFullName: () => `${current.getFriendlyFullName()}`,
1614
} as DeclarationReflection;
1715
return parseDeclarations(childObj, acc);
1816
},

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

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -47,12 +47,7 @@ export function declarationTitle(
4747
name.push(backTicks('set') + ' ');
4848
}
4949

50-
const nameParts = model.name.split('.');
51-
52-
const declarationName =
53-
Boolean(model.escapedName) && nameParts.length > 1
54-
? nameParts[nameParts.length - 1]
55-
: model.name;
50+
const declarationName = (model as any)?.originalName || model.name;
5651

5752
const displayDeclarationName = this.options.getValue('useHTMLEncodedBrackets')
5853
? encodeAngleBrackets(declarationName)

packages/typedoc-plugin-markdown/test/__snapshots__/reflections/members.opts-1.functions-functionReturningFunctionOverloads.md.snap

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -133,3 +133,7 @@ Comments for function
133133
> **prop**: `string`
134134

135135
Comments for prop
136+
137+
#### member4.prop.with.dot
138+
139+
> **prop.with.dot**: `string`

packages/typedoc-plugin-markdown/test/__snapshots__/reflections/members.opts-2.functions-functionReturningFunctionOverloads.md.snap

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,3 +19,4 @@ Return comments
1919
| `member3()` | (`options?`: `any`) => [`Promise`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise)\<`void`\> | Member 3 comments Comments for function |
2020
| `member4` | `object` | - |
2121
| `member4.prop` | `string` | Comments for prop |
22+
| `member4.prop.with.dot` | `string` | - |

packages/typedoc-plugin-markdown/test/fixtures/src/reflections/interfaces.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -280,4 +280,5 @@ export interface InterfaceWithProps {
280280
* Comments for prop
281281
*/
282282
prop: string;
283+
['prop.with.dot']: string;
283284
}

0 commit comments

Comments
 (0)