GNOME Bugzilla – Bug 567047
HTML parser adds whitespace
Last modified: 2021-07-05 13:24:29 UTC
Please describe the problem: The HTML parser seems to add whitespace around block-level elements. For instance: <ul><li>item1</li><li>item2</li></ul> When using xmllint -html you get: <ul> <li>item1</li> <li>item2</li> </ul> This appears safe, but with some CSS rules this whitespace addition will change rendering. Specifically if you use the CSS: li {display: inline} The first case renders in a browser as "item1item2" and the second case "item1 item2" Steps to reproduce: Parse a document with <li> elements with no whitespace between the elements. The parse will include inserted whitespace. Actual results: Expected results: There shouldn't be any included whitespace; the parse shouldn't change the document. Does this happen every time? Yes. Other information:
GNOME is going to shut down bugzilla.gnome.org in favor of gitlab.gnome.org. As part of that, we are mass-closing older open tickets in bugzilla.gnome.org which have not seen updates for a longer time (resources are unfortunately quite limited so not every ticket can get handled). If you can still reproduce the situation described in this ticket in a recent and supported software version, then please follow https://wiki.gnome.org/GettingInTouch/BugReportingGuidelines and create a new ticket at https://gitlab.gnome.org/GNOME/libxml2/-/issues/ Thank you for your understanding and your help.