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

Space between html tags is huge even tho I wrapped my content in "<div>" #319

Open
nikita-zot-1408 opened this issue May 4, 2021 · 5 comments

Comments

@nikita-zot-1408
Copy link

I have very big distance between elements even tho I have my code like this.

<HTMLView
          value={`<div>${currentPostDetails?.text.replace(
            /<br\\?>|\r?\n\s*/g,
            '',
          )}</div>`}
          stylesheet={checkTheme ? webViewStyleLight : webViewStyleDark}
        />

My content is still displayed like this:

Screenshot 2021-05-04 at 12 21 23

Any suggestions on how to solve this please?

@nikita-zot-1408 nikita-zot-1408 changed the title Space between html tags is huge even tho I wrapper my content in "<div>" Space between html tags is huge even tho I wrapped my content in "<div>" May 4, 2021
@akenarong999
Copy link

Got this problem too. Any solution?... pls.

@yestay90
Copy link

the same is here.

@daveyjones
Copy link

You need to add addLineBreaks={false}.

@MohdUmer
Copy link

when use addLineBreaks={false} height still to huge... any solution?

@joemewes
Copy link

joemewes commented Aug 5, 2024

I had this also, even with addLineBreaks={false}. I found lots of null in RootComponent element with a children data value of '\n\n'. Don't have time to fully debug but a temp fix for me was to add the following in my custom renderNode function.

if (node.data === '\n\n') {
      return null;
}  

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