Editing overrides in nested markdown
Opened this issue · 0 comments
SKOLZ commented
Hello!
I have defined some overrides to used for some markdown but I want to define in one of those overrides an override to the overrides. Something like:
<Markdown
children={source}
overrides={{
h1: ({children}) => (<h2>{children}</h2>),
CustomComponent: ({children}) => (
<Markdown
children={children}
overrides={{
h1: ({children}) => (<h3>{children}</h3>)
}}
/>
)
}}
/>
this doesn't work because the children my overrides component function receives is no longer a string. After searching a bunch and not being able to find a solution I was wondering, Is there any way to achieve this? maybe a "decompile" function to revert the children object back to markdown or something along those lines? Thank you for the help!