Parse markdown h4 and h5 to have anchors.
This commit is contained in:
parent
42600f4701
commit
31c5282112
@ -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
|
||||
},
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user