Skip to content

Commit e20bb79

Browse files
committed
Ignore unknown CommentDisplayParts and raise warning instead of error
1 parent 896900e commit e20bb79

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

sphinx_js/js/convertTopLevel.ts

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -253,15 +253,16 @@ class PathComputer implements ReflectionVisitor {
253253
* @returns
254254
*/
255255
function renderCommentContent(content: CommentDisplayPart[]): Description {
256-
return content.map((x): DescriptionItem => {
256+
return content.map((x) => {
257257
if (x.kind === "code") {
258258
return { type: "code", code: x.text };
259259
}
260260
if (x.kind === "text") {
261261
return { type: "text", text: x.text };
262262
}
263-
throw new Error("Not implemented");
264-
});
263+
console.warn(`Not implemented:`, x);
264+
return null;
265+
}).filter(Boolean) as DescriptionItem[];
265266
}
266267

267268
function renderCommentSummary(c: Comment | undefined): Description {

0 commit comments

Comments
 (0)