iamacup / react-native-markdown-display

React Native 100% compatible CommonMark renderer

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

textAlign: "center" not working on second paragraph

g-hamilton opened this issue · comments

Given the following:

image

I would expect all text to centre align. However, in my Markdown editor, adding this:

image

Results in the component rendering this:

image

The second paragraph should be centre aligned shouldn't it?

PS. I have tried adding paragraph: {textAlign: "center"} to my Markdown styles but that didn't help.

Thanks

@g-hamilton Hi I was facing some issues trying to center some text too, and this is how I fixed:

<Markdown
  style={{
    body: {
      ...Typography.FontStyle.SUBHEADING,
      color: Colors.TextPlaceholder,
      includeFontPadding: false,
    },
    textgroup: {
      textAlign: 'center',
    },
    strong: {
      color: Colors.Text,
    },
  }}
>
  {children}
</Markdown>

I added the textgroup style property

Thanks @jtvargas very helpful 👍🏻