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 {
|
||||
...components,
|
||||
// Typography
|
||||
h1: ({ children }) => (
|
||||
<h1 className="scroll-m-20 font-sans text-4xl font-extrabold tracking-tight lg:text-5xl mt-10 mb-4 text-ink">
|
||||
{children}
|
||||
h1: (props) => (
|
||||
<h1 {...props} className="scroll-m-20 font-sans text-4xl font-extrabold tracking-tight lg:text-5xl mt-10 mb-4 text-ink">
|
||||
{props.children}
|
||||
</h1>
|
||||
),
|
||||
h2: ({ children }) => (
|
||||
<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">
|
||||
{children}
|
||||
h2: (props) => (
|
||||
<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">
|
||||
{props.children}
|
||||
</h2>
|
||||
),
|
||||
h3: ({ children }) => (
|
||||
<h3 className="scroll-m-20 font-sans text-2xl font-semibold tracking-tight mt-8 mb-3 text-ink">
|
||||
{children}
|
||||
h3: (props) => (
|
||||
<h3 {...props} className="scroll-m-20 font-sans text-2xl font-semibold tracking-tight mt-8 mb-3 text-ink">
|
||||
{props.children}
|
||||
</h3>
|
||||
),
|
||||
p: ({ children }) => (
|
||||
|
||||
Reference in New Issue
Block a user