mirror of
https://github.com/discordjs/discord.js.git
synced 2024-08-21 18:04:44 +12:00
fix(website): resolve linkTags in meta description (#10088)
* fix(website): resolve linkTags in summaries * fix: case body as block * fix: add discord-api-types support * fix: remove urlDestination when undefined * fix: breaks to if/else --------- Co-authored-by: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com>
This commit is contained in:
parent
9f8d7fe7b4
commit
56943a72f4
1 changed files with 17 additions and 2 deletions
|
@ -60,9 +60,24 @@ export function tryResolveSummaryText(item: ApiDeclaredItem): string | null {
|
|||
case DocNodeKind.PlainText:
|
||||
retVal += (node as DocPlainText).text;
|
||||
break;
|
||||
case DocNodeKind.LinkTag:
|
||||
retVal += (node as DocLinkTag).urlDestination;
|
||||
case DocNodeKind.LinkTag: {
|
||||
const { codeDestination, urlDestination, linkText } = node as DocLinkTag;
|
||||
if (codeDestination) {
|
||||
const declarationReference = item.getAssociatedModel()?.resolveDeclarationReference(codeDestination, item);
|
||||
if (declarationReference?.resolvedApiItem) {
|
||||
const foundItem = declarationReference.resolvedApiItem;
|
||||
retVal += linkText ?? foundItem.displayName;
|
||||
} else {
|
||||
const typeName = codeDestination.memberReferences.map((ref) => ref.memberIdentifier?.identifier).join('.');
|
||||
retVal += typeName;
|
||||
}
|
||||
} else {
|
||||
retVal += linkText ?? urlDestination;
|
||||
}
|
||||
|
||||
break;
|
||||
}
|
||||
|
||||
case DocNodeKind.Section:
|
||||
case DocNodeKind.Paragraph: {
|
||||
for (const child of (node as DocParagraph).nodes) {
|
||||
|
|
Loading…
Reference in a new issue