Skip to content

Commit 3be522f

Browse files
committed
shift children in extract
1 parent cb25eb5 commit 3be522f

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

src/generators/jsx-ast/utils/buildPropertyTable.mjs

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,12 +36,16 @@ export const classifyTypeNode = node => {
3636
* @param {Array<import('mdast').PhrasingContent>} children - Paragraph content nodes
3737
*/
3838
export const extractPropertyName = children => {
39-
if (!children.length) return;
39+
if (!children.length) {
40+
return;
41+
}
4042

4143
const first = children[0];
4244

4345
// Inline code (`foo`) becomes <code>foo</code>
4446
if (first.type === 'inlineCode') {
47+
// Remove the node from the children, as we processed it.
48+
children.shift();
4549
return createElement('code', first.value.trimEnd());
4650
}
4751

0 commit comments

Comments
 (0)