Skip to content

Commit d1ee417

Browse files
committed
fix(nx-dev): update markdoc component to exclude h1 headers
1 parent 1d9d911 commit d1ee417

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

nx-dev/ui-markdoc/src/lib/tags/table-of-contents.component.tsx

+2-2
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ export function TableOfContents({
2323
if (!content) return;
2424

2525
// Get all headings h1-h6 within the content
26-
const headingElements = content.querySelectorAll('h1, h2, h3, h4, h5, h6');
26+
const headingElements = content.querySelectorAll('h2, h3, h4, h5, h6');
2727

2828
const items: TocItem[] = Array.from(headingElements)
2929
.map((heading) => {
@@ -54,7 +54,7 @@ export function TableOfContents({
5454
{headings.map((heading) => (
5555
<li
5656
key={heading.id}
57-
style={{ paddingLeft: `${(heading.level - 1) * 1}rem` }}
57+
style={{ paddingLeft: `${(heading.level - 2) * 1}rem` }}
5858
>
5959
<a
6060
href={`#${heading.id}`}

0 commit comments

Comments
 (0)