iamacup / react-native-markdown-display

React Native 100% compatible CommonMark renderer
MIT License
590 stars 169 forks source link

List items (ordered + unordered) are not rendered on same line #161

Closed hassiebp closed 2 years ago

hassiebp commented 2 years ago

Hey all,

happy new year!

Unfortunately markdown with ordered or unordered lists are not rendered on the same line / aligned correctly. Any hints on how to fix this behavior? Snack with minimal repro: https://snack.expo.dev/@hassieb/react-native-markdown-display-ordered-list

rendered lists

hannojg commented 2 years ago

is this on android? You might want to set includeFontPadding: false in the styles of the markdown component and try that

hassiebp commented 2 years ago

Thanks for the suggestion @hannojg ! Unfortunately, this issue exist cross-platform (see link to Snack above) and the includeFontPadding option does not fix the issue at least from what I've tried

difasulthon commented 2 years ago

I have the same issue, how to fix it?

malikbanuaji commented 2 years ago

i think adding width to ordered_list_icon or unordered_list_icon fix it, it was not aligned correctly because they have different font width.

markdown: {
  ordered_list_icon: {
    width: 14 // or your value
  }
}
difasulthon commented 2 years ago

i think adding width to ordered_list_icon or unordered_list_icon fix it, it was not aligned correctly because they have different font width.

markdown: {
  ordered_list_icon: {
    width: 14 // or your value
  }
}

It is solved for me. Thank you for the suggestion