jsdf/react-native-htmlview

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

nikita-zot-1408 opened this issue · 5 comments

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?

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

the same is here.

You need to add addLineBreaks={false}.

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

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;
}