Skip to content

Commit 6484894

Browse files
committed
Handle inline-tag and relative-link CommentDisplayParts
1 parent dff885c commit 6484894

File tree

1 file changed

+12
-6
lines changed

1 file changed

+12
-6
lines changed

sphinx_js/js/convertTopLevel.ts

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -254,13 +254,19 @@ class PathComputer implements ReflectionVisitor {
254254
*/
255255
function renderCommentContent(content: CommentDisplayPart[]): Description {
256256
return content.map((x): DescriptionItem => {
257-
if (x.kind === "code") {
258-
return { type: "code", code: x.text };
257+
switch (x.kind) {
258+
case "code":
259+
return { type: "code", code: x.text };
260+
case "text":
261+
return { type: "text", text: x.text };
262+
// TODO: Add to DescriptionItem
263+
case "inline-tag":
264+
return { type: "text", text: x.text };
265+
case "relative-link":
266+
return { type: "text", text: x.text };
267+
default:
268+
throw new Error("Not implemented");
259269
}
260-
if (x.kind === "text") {
261-
return { type: "text", text: x.text };
262-
}
263-
throw new Error("Not implemented");
264270
});
265271
}
266272

0 commit comments

Comments
 (0)