Skip to content

Commit eb8d2c4

Browse files
authored
Update index.mjs
1 parent b35df71 commit eb8d2c4

1 file changed

Lines changed: 2 additions & 4 deletions

File tree

plugins/theme/helpers/index.mjs

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ export default (ctx) => ({
6969
* Renders `@example` tags from a comment as Markdown.
7070
* Pass `headingLevel` to prepend a heading (block context);
7171
* omit it for inline use (e.g. inside a list item).
72-
* Always returns a string never `null`.
72+
* Always returns a string never `null`.
7373
*
7474
* @param {import("typedoc").Comment | import("typedoc").CommentTag | null | undefined} comment
7575
* @param {number} [headingLevel]
@@ -83,17 +83,15 @@ export default (ctx) => ({
8383
const bodies = examples
8484
.map((tag) => {
8585
const body = ctx.helpers.getCommentParts(tag.content).trim();
86-
if (!body) return null; // skip empty @example tags
86+
if (!body) return null;
8787

8888
if (headingLevel != null) {
89-
// Block context (signature / comment partial) → add heading
9089
const prefix = "#".repeat(headingLevel + 1);
9190
const suffix =
9291
examples.length > 1 ? ` ${examples.indexOf(tag) + 1}` : "";
9392
return `${prefix} Example${suffix}\n\n${body}`;
9493
}
9594

96-
// Inline context (typedListItem) → no heading, just body
9795
return body;
9896
})
9997
.filter(Boolean);

0 commit comments

Comments
 (0)