Skip to content

Commit d04ea32

Browse files
committed
Fix media links if referenced multiple times
Resolves #2627
1 parent dae2527 commit d04ea32

File tree

3 files changed

+6
-0
lines changed

3 files changed

+6
-0
lines changed

Diff for: CHANGELOG.md

+1
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44

55
- The page navigation sidebar no longer incorrectly includes re-exports if the same member is exported with multiple names #2625.
66
- Page navigation now ensures the current page is visible when the page is first loaded, #2626.
7+
- If a relative linked image is referenced multiple times, TypeDoc will no longer sometimes produce invalid links to the image #2627.
78
- Comments on re-exports are now rendered.
89

910
### Thanks!

Diff for: src/lib/models/FileRegistry.ts

+4
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,10 @@ export class FileRegistry {
6161
const absolute = this.mediaToPath.get(id);
6262
if (!absolute) return;
6363

64+
if (this.names.has(id)) {
65+
return this.names.get(id);
66+
}
67+
6468
const file = basename(absolute);
6569
if (!this.nameUsage.has(file)) {
6670
this.nameUsage.set(file, 1);

Diff for: src/test/comments.test.ts

+1
Original file line numberDiff line numberDiff line change
@@ -1509,6 +1509,7 @@ describe("Comment Parser", () => {
15091509
] satisfies CommentDisplayPart[]);
15101510

15111511
equal(files.getName(1), "&a.png");
1512+
equal(files.getName(1), "&a.png");
15121513
});
15131514
});
15141515

0 commit comments

Comments
 (0)