Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Editing overrides in nested markdown #593

Open
SKOLZ opened this issue Jun 28, 2024 · 0 comments
Open

Editing overrides in nested markdown #593

SKOLZ opened this issue Jun 28, 2024 · 0 comments

Comments

@SKOLZ
Copy link

SKOLZ commented Jun 28, 2024

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!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant