Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

how to set paragraph space #142

Closed
Liqiankun opened this issue Aug 3, 2017 · 9 comments
Closed

how to set paragraph space #142

Liqiankun opened this issue Aug 3, 2017 · 9 comments

Comments

@Liqiankun
Copy link

Liqiankun commented Aug 3, 2017

This is my style of p tag

const htmlStyle = StyleSheet.create({
  p: {
    margin: 5
  }
});

But It does not work. The paragraph space is still huge!
simulator screen shot 2017 8 3 6 36 14

@Liqiankun
Copy link
Author

After I set addLineBreaks={false}the space is still not what I want!

@bas-ie
Copy link
Collaborator

bas-ie commented Aug 4, 2017

We currently aren't able to fine-tune paragraph spacing beyond using paragraphBreak, lineBreak, and addLineBreaks. PRs in that area very welcome though 😄

@Liqiankun
Copy link
Author

@richchurcher OK, thanks man!

@bas-ie bas-ie closed this as completed Aug 7, 2017
@Jayiitb
Copy link

Jayiitb commented Aug 29, 2017

Thanks for this wonderful component.
Any progress on this issue?

@bas-ie
Copy link
Collaborator

bas-ie commented Sep 24, 2017

@Jayiitb no, but it's definitely something I'm looking at. I feel like there ought to be a way for us to set marginTop sensibly, so I'm investigating that.

@bas-ie
Copy link
Collaborator

bas-ie commented Sep 24, 2017

Note that doing something like this comes pretty close:

    return (
        <HTMLView
          addLineBreaks={false}
          stylesheet={richTextStyles}
          value={content} />
    )

// ...

const richTextStyles = StyleSheet.create({
  p: {
    marginTop: 3,
    marginBottom: 3
  }
})

@optimatex
Copy link

@richchurcher That works very well in my case. Thanks!

@eidsza1
Copy link

eidsza1 commented May 2, 2020

This works perfect

value={"<div>"+ item +"</div>"}

@gyawalirajiv
Copy link

Thanks @eidsza1 and @richchurcher . worked

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants