fix: spread props on MDX heading components to enable TOC IDs
This commit is contained in:
@@ -4,19 +4,19 @@ export function useMDXComponents(components: MDXComponents): MDXComponents {
|
|||||||
return {
|
return {
|
||||||
...components,
|
...components,
|
||||||
// Typography
|
// Typography
|
||||||
h1: ({ children }) => (
|
h1: (props) => (
|
||||||
<h1 className="scroll-m-20 font-sans text-4xl font-extrabold tracking-tight lg:text-5xl mt-10 mb-4 text-ink">
|
<h1 {...props} className="scroll-m-20 font-sans text-4xl font-extrabold tracking-tight lg:text-5xl mt-10 mb-4 text-ink">
|
||||||
{children}
|
{props.children}
|
||||||
</h1>
|
</h1>
|
||||||
),
|
),
|
||||||
h2: ({ children }) => (
|
h2: (props) => (
|
||||||
<h2 className="scroll-m-20 border-b border-border pb-2 font-sans text-3xl font-semibold tracking-tight mt-12 mb-4 first:mt-0 text-ink">
|
<h2 {...props} className="scroll-m-20 border-b border-border pb-2 font-sans text-3xl font-semibold tracking-tight mt-12 mb-4 first:mt-0 text-ink">
|
||||||
{children}
|
{props.children}
|
||||||
</h2>
|
</h2>
|
||||||
),
|
),
|
||||||
h3: ({ children }) => (
|
h3: (props) => (
|
||||||
<h3 className="scroll-m-20 font-sans text-2xl font-semibold tracking-tight mt-8 mb-3 text-ink">
|
<h3 {...props} className="scroll-m-20 font-sans text-2xl font-semibold tracking-tight mt-8 mb-3 text-ink">
|
||||||
{children}
|
{props.children}
|
||||||
</h3>
|
</h3>
|
||||||
),
|
),
|
||||||
p: ({ children }) => (
|
p: ({ children }) => (
|
||||||
|
|||||||
Reference in New Issue
Block a user