react-native-markdown-renderer icon indicating copy to clipboard operation
react-native-markdown-renderer copied to clipboard

Native crash when nesting Views within Text

Open yleflour opened this issue 7 years ago • 1 comments
trafficstars

In my current project, the markdown which is provided to me is not always "clean" it sometimes has a list within a list or an image within inline text, etc.

The issue comes from having bloc content within text content which tries to render a View within a Text node. This turns into a native crash from the rendering bridge which cannot be caught in JS.

The way I fixed it was by providing an inline: true parameter to the state which allows me to detect such issues an thus avoid native crashes.

Unfortunately I don't have the time to create a pull request for the library but if you find this solution useful, here is a gist showing how I implemented it. Please note that the code is written in Typescript.

yleflour avatar Oct 02 '18 10:10 yleflour

I had faced this issue and after checking my code, I see that I overrode the paragraph rule with a Text component.

baochungit avatar Jul 27 '19 19:07 baochungit