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

Support for images inside strong/bolded tags

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

I'm using this package to render markdown text that was converted from existing html. I have an image that is wrapped inside <b> tags, like so:

<b>
  <img src="https://via.placeholder.com/350x150" alt="My photo" /> test image
</b>

Which gets converted into:

 **![My photo](https://via.placeholder.com/350x150) test image**

This does not get rendered on iOS properly, and crashes on Android because we're trying to render an image inside of bolded text. Of course, an image cannot be bolded, but that is valid html and valid markdown.

Can this be added? Or if not, any thoughts on a workaround?

yashafromrussia avatar Aug 21 '18 17:08 yashafromrussia

I wrote a quick parser that strips images of all parent tags to avoid this issue.

Note: this severe of an issue should probably indicate that you should use some other library entirely, but of the 3 or 4 I've tested thoroughly now, this one actually has the least severe issues. So, I'm putting in these sorts of hacks.

lancedolan avatar Apr 02 '19 17:04 lancedolan