fix(toc): unnecessary <ol> when no children

This commit is contained in:
Elian Doran 2026-01-09 11:25:24 +02:00
parent ae4a3f10ae
commit 8cff591746
No known key found for this signature in database

View File

@ -115,7 +115,7 @@ function TableOfContentsHeading({ heading, scrollToHeading, activeHeadingId }: {
html={heading.text}
/>
</li>
{heading.children && (
{heading.children.length > 0 && (
<ol>
{heading.children.map(heading => <TableOfContentsHeading key={heading.id} heading={heading} scrollToHeading={scrollToHeading} activeHeadingId={activeHeadingId} />)}
</ol>