juiceo / react-native-easy-markdown

Simple & customizable React Native component to render Github-flavoured markdown using minimal native components.
https://www.npmjs.com/package/react-native-easy-markdown
65 stars 62 forks source link

Nested unordered lists are not rendered correctly #14

Open dbelchev opened 6 years ago

dbelchev commented 6 years ago

I saw a problem with the rendering of nested unordered lists:

  1. Unordered list without nesting - rendered correctly: <Markdown> {"* Bullet 1\n* Bullet 2"} </Markdown>

    screen shot 2018-01-29 at 15 58 58
  2. Unordered list with nesting - not correct: <Markdown> {"* Parent Bullet\n * Nested Bullet"} </Markdown>

    screen shot 2018-01-29 at 15 59 54

Thank you!

juiceo commented 6 years ago

@dbelchev Thanks for submitting the issue! Originally this was a feature I decided I didn't need myself so did not put time into making it work. I think mainly the thought process was that markdown is not really the best for such complex structures anyway.

If it is something that you desperately need, I'm sure proper support for nested lists would be quite easy to implement in the code (see renderList and how the ordered parameter is passed into renderNodes -> a nested parameter could be passed similarly ). I would be happy to accept a PR for such a feature if you are interested in trying to implement it.