jsdf / react-native-htmlview

A React Native component which renders HTML content as native views
ISC License
2.71k stars 467 forks source link

Unordered List followed by Paragraph not rendering properly #318

Open KrisChambers opened 3 years ago

KrisChambers commented 3 years ago

Consider the following html: <html><body><ul><li>Item 1</li></ul><p>Paragraph</p><p>P2</p></body></html>

Expected output:

Paragraph

P2

Actual output:

P2

Check Android and IOs at the this Snack Link

I would expect a new paragraph to be started after the list. As is the case for html rendered in the browser.

Hacky Solution:

  1. Manually add newlines after list
  2. while (html.indexOf("ul><p") > -1) { html = html.replace("><p", ">\n\n<p"); }
SaruwatariSagittario commented 3 years ago

Hi, I'm also facing some issue when trying to render ul li html tags, is there any solution or workaround ?

KrisChambers commented 3 years ago

In my case, the workaround has been to add line breaks (\<br />) to the markup. The main issue for me seems to be the formatting of the list when sandwiched between paragraphs.

Mihai-github commented 1 year ago

for me, a list of ul > li with many li tags breaks