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

textAlign: "center" not working on second paragraph

Open g-hamilton opened this issue 1 year ago • 2 comments

Given the following:

image

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

image

Results in the <Markdown> 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 avatar Feb 23 '24 14:02 g-hamilton

@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

jtvargas avatar Mar 21 '24 22:03 jtvargas

Thanks @jtvargas very helpful 👍🏻

g-hamilton avatar Apr 05 '24 14:04 g-hamilton