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

Markdown stops rendering after custom components #497

Open
SParmentier opened this issue May 30, 2023 · 1 comment
Open

Markdown stops rendering after custom components #497

SParmentier opened this issue May 30, 2023 · 1 comment

Comments

@SParmentier
Copy link

SParmentier commented May 30, 2023

If we want to use a bold for example after a custom component, the markdown will render correctly the custom component but not the following text. It seems to be only when the markdown is on multi lines.

const Text = (props) => <span style={{ color: 'red' }}>{props.children}</span>

# Important to put on multi lines here
const markdown = `
<Text>Hello world!</Text> **bold**
`;

<Markdown options={{ overrides: { Text: { component: Text } } }} >
  {markdown}
</Markdown>

Expected: bold
Result: **bold**

It was working fine in version 7.1.5 but not since 7.1.6.

@bhainesva
Copy link

I'm also experiencing this, with default html elements as well as custom components.

Can reproduce on https://probablyup.com/markdown-to-jsx/ with (the newline is important):

<div></div> **bold**

image

I'm using 7.2.1, downgrading to 7.1.5 also fixes it for me.

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

2 participants