diff --git a/CHANGELOG.md b/CHANGELOG.md index 08b1999fb..52b394e27 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,9 @@ # Unreleased +### Bug Fixes + +- Fixed an issue where links in packages mode would be resolved incorrectly, #2680. + ## v0.26.6 (2024-08-18) ### Features diff --git a/src/lib/converter/comments/linkResolver.ts b/src/lib/converter/comments/linkResolver.ts index 135f0a158..1ee32f909 100644 --- a/src/lib/converter/comments/linkResolver.ts +++ b/src/lib/converter/comments/linkResolver.ts @@ -4,7 +4,7 @@ import { type CommentDisplayPart, DeclarationReflection, type InlineTagDisplayPart, - type Reflection, + Reflection, ReflectionSymbolId, } from "../../models"; import { @@ -112,6 +112,12 @@ function resolveLinkTag( externalResolver: ExternalSymbolResolver, options: LinkResolverOptions, ): InlineTagDisplayPart { + // This tag may have already been resolved to if we are running in packages mode + // or when reading in a JSON file. #2680. + if (typeof part.target === "string" || part.target instanceof Reflection) { + return part; + } + let defaultDisplayText = ""; let pos = 0; const end = part.text.length;