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

Markdown stops rendering after custom components

Open SParmentier opened this issue 2 years ago • 4 comments

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.

SParmentier avatar May 30 '23 07:05 SParmentier

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.

bhainesva avatar Aug 02 '23 16:08 bhainesva

Facing same issue on 7.4.7. @quantizor any updates/plans to fix this ?

ghorela3ishan avatar May 31 '24 08:05 ghorela3ishan

Will try to take a look this weekend

quantizor avatar May 31 '24 12:05 quantizor

@quantizor Were you able to check this ?

ghorela3ishan avatar Jul 09 '24 07:07 ghorela3ishan