1
0

Parse markdown h4 and h5 to have anchors.

This commit is contained in:
Kevin Matsubara 2024-10-26 12:33:09 +02:00
parent 42600f4701
commit 31c5282112

View File

@ -13,6 +13,14 @@ const MyParagraph = ({ children, ...props }) => {
return (<h1 {...props}>{children}</h1>);
}
const Myh4 = ({ children }) => {
return (<h4 id={children}>{children}</h4>);
}
const Myh5 = ({ children }) => {
return (<h5 id={children}>{children}</h5>);
}
const MyImage = ({ src, alt }) => {
return (
<picture>
@ -103,6 +111,12 @@ const MarkdownPage = ({ md }) => {
className: 'text-primary',
},
},
h4: {
component: Myh4
},
h5: {
component: Myh5
},
img: {
component: MyImage
},