markdown-to-jsx
markdown-to-jsx copied to clipboard
Paragraph overrides blockquote when using overrides
Hi 👋 When using the overrides
feature, paragraph overrides blockquote, not allowing to customize blockquote text differently.
Sandbox reproduction: https://codesandbox.io/s/jolly-swanson-s817n?file=/src/App.js:338-391
I'm experiencing this as well.
Any updates?
Facing the same issue, any updates??
From the code perspective, the regular expression for blockquote
is using this expression
/^( *>[^\n]+(\n[^\n]+)*\n*)+\n{2,}/
That means a double \n\n
might do the trick. but still not working correctly !
I've opened a PR here https://github.com/probablyup/markdown-to-jsx/pull/442 Hopefully it make sense.
The problem is we still continue processing the inner content of the blockquote to feed into your custom component, so you end up with nested paragraph tags, the deepest one being rendered by us with the coloring from the defined override…
Perhaps a way we could get around this is to inject the compiler and raw inner content as props into your custom component so you can choose to provide different options when rendering the blockquote to get your desired result.
(This would be a breaking change, but feels like probably a good addition.)