Skip to content

Commit 5bf3c64

Browse files
flakey5avivkeller
andauthored
Update src/generators/json/utils/sections/base.mjs
Co-authored-by: Aviv Keller <me@aviv.sh>
1 parent ae34640 commit 5bf3c64

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

  • src/generators/json/utils/sections

src/generators/json/utils/sections/base.mjs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,8 @@ export function addDescriptionAndExamples(section, nodes) {
4141
} else {
4242
section['@example'] = node.value;
4343
}
44-
44+
const examples = [...enforceArray(section['@example']), node.value];
45+
section['@example'] = examples.length === 1 ? examples[0] : examples;
4546
return;
4647
}
4748

0 commit comments

Comments
 (0)