Skip to content

Commit 5f33778

Browse files
committed
fix(docs): handle LinkTag elements without uri property
1 parent f901a2c commit 5f33778

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

src/functions/docs.ts

+1-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
import process from 'node:process';
22
import { bold, codeBlock, hyperlink, inlineCode, strikethrough, underline } from '@discordjs/builders';
3-
import { InteractionResponseType } from 'discord-api-types/v10';
43
import type { Response } from 'polka';
54
import { fetch } from 'undici';
65
import {
@@ -203,7 +202,7 @@ function effectiveItem(item: any, member?: string) {
203202
function formatSummary(blocks: any[], _package: string, version: string) {
204203
return blocks
205204
.map((block) => {
206-
if (block.kind === 'LinkTag') {
205+
if (block.kind === 'LinkTag' && block.uri) {
207206
const isFullLink = block.uri.startsWith('http');
208207
const link = isFullLink ? block.uri : `${DJS_DOCS_BASE}/packages/${_package}/${version}/${block.uri}`;
209208
return hyperlink(block.members ? `${block.text}${block.members}` : block.text, link);

0 commit comments

Comments
 (0)