markdown-to-jsx icon indicating copy to clipboard operation
markdown-to-jsx copied to clipboard

Editing overrides in nested markdown

Open SKOLZ opened this issue 2 weeks ago • 0 comments

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!

SKOLZ avatar Jun 28 '24 09:06 SKOLZ