Steps: Open Writer Write some text Add some bullets and text Add some text. File => "Save a Copy..." => "Save as Type" := "HTML" => Save Open the saved file. The result is like (fragment): <ul> <li><p style="text-indent: 0cm; margin-top: 0cm; line-height: 100%">midagi</p> <li><p style="text-indent: 0cm; margin-top: 0cm; line-height: 100%">kedasi</p> <li><p style="text-indent: 0cm; margin-top: 0cm; line-height: 100%">kuidagi</p> <li><p style="text-indent: 0cm; margin-top: 0cm; line-height: 100%">OK</p> </ul> There are no "</li>" tags after "</p>". This is a bug. Why "<p style="text-indent: 0cm; margin-top: 0cm; line-height: 100%">" needed at all as default?
On which env are you? (MacOs, Windows, Linux) Could you give a try with last stable LO version 6.4.5?
I use Win7. I just tested with LibreOffice 7.0.0.3. The result was the same.
On pc Debian x86-64 with master sources updated today, I could reproduce this.
The li element has an end tag (</li>), but itβs optional in some cases: An li element's end tag may be omitted if the li element is immediately followed by another li element or if there is no more content in the parent element. Should we go for XHTML compliance here and close the li tag?
Hm, not so easy to correctly close and open nested lists because I have not the insight in that part of the code :(
Miklos: reading some docs it seems ending li is optional in html in some cases. But what about putting it anyway and just use this simple patch: diff --git a/sw/source/filter/html/htmlnumwriter.cxx b/sw/source/filter/html/htmlnumwriter.cxx index f41ac73929f9..a556f4139da4 100644 --- a/sw/source/filter/html/htmlnumwriter.cxx +++ b/sw/source/filter/html/htmlnumwriter.cxx @@ -354,18 +354,16 @@ Writer& OutHTML_NumberBulletListEnd( SwHTMLWriter& rWrt, } } - if (rWrt.mbXHTML) + // The list is numbered if the previous text node is numbered or any other previous text + // node is numbered. + bool bPrevIsNumbered = rInfo.IsNumbered() || *oAtLeastOneNumbered; + // XHTML </li> for the list item content, if there is an open <li>. + // also for HTML even if it's optional, it can't be bad (see tdf#135449) + if ((bListEnd && bPrevIsNumbered) || (!bListEnd && rNextInfo.IsNumbered())) { - // The list is numbered if the previous text node is numbered or any other previous text - // node is numbered. - bool bPrevIsNumbered = rInfo.IsNumbered() || *oAtLeastOneNumbered; - // XHTML </li> for the list item content, if there is an open <li>. - if ((bListEnd && bPrevIsNumbered) || (!bListEnd && rNextInfo.IsNumbered())) - { - HTMLOutFuncs::Out_AsciiTag( - rWrt.Strm(), OStringConcatenation(rWrt.GetNamespace() + OOO_STRING_SVTOOLS_HTML_li), - false); - } + HTMLOutFuncs::Out_AsciiTag( + rWrt.Strm(), OStringConcatenation(rWrt.GetNamespace() + OOO_STRING_SVTOOLS_HTML_li), + false); } if (!bListEnd) ?
Created attachment 181510 [details] Nested List Thank you for your patch! I tried to tackle this bug, too, but in a nested list case, it produces wrong HTML code :( Wrong output: <ul> <li> <p style="line-height: 100%; margin-bottom: 0in">A</p> </li> <ul> <li> <p style="line-height: 100%; margin-bottom: 0in">One</p> </li> <li> <p style="line-height: 100%; margin-bottom: 0in">Two</p> </li> </ul> <li> <p style="line-height: 100%; margin-bottom: 0in">B</p> </li> </ul> Should be: <ul> <li> <p style="line-height: 100%; margin-bottom: 0in">A</p> <ul> <li> <p style="line-height: 100%; margin-bottom: 0in">One</p> </li> <li> <p style="line-height: 100%; margin-bottom: 0in">Two</p> </li> </ul> </li> <li> <p style="line-height: 100%; margin-bottom: 0in">B</p> </li> </ul>
(In reply to Andreas Heinisch from comment #7) > Created attachment 181510 [details] > Nested List > > Thank you for your patch! I tried to tackle this bug, too, but in a nested > list case, it produces wrong HTML code :( > ... Indeed :-( (I wanted to give a try to exporting in xhtml but it's not in the list)
Dear Erkki Laaneoks, To make sure we're focusing on the bugs that affect our users today, LibreOffice QA is asking bug reporters and confirmers to retest open, confirmed bugs which have not been touched for over a year. There have been thousands of bug fixes and commits since anyone checked on this bug report. During that time, it's possible that the bug has been fixed, or the details of the problem have changed. We'd really appreciate your help in getting confirmation that the bug is still present. If you have time, please do the following: Test to see if the bug is still present with the latest version of LibreOffice from https://www.libreoffice.org/download/ If the bug is present, please leave a comment that includes the information from Help - About LibreOffice. If the bug is NOT present, please set the bug's Status field to RESOLVED-WORKSFORME and leave a comment that includes the information from Help - About LibreOffice. Please DO NOT Update the version field Reply via email (please reply directly on the bug tracker) Set the bug's Status field to RESOLVED - FIXED (this status has a particular meaning that is not appropriate in this case) If you want to do more to help you can test to see if your issue is a REGRESSION. To do so: 1. Download and install oldest version of LibreOffice (usually 3.3 unless your bug pertains to a feature added after 3.3) from https://downloadarchive.documentfoundation.org/libreoffice/old/ 2. Test your bug 3. Leave a comment with your results. 4a. If the bug was present with 3.3 - set version to 'inherited from OOo'; 4b. If the bug was not present in 3.3 - add 'regression' to keyword Feel free to come ask questions or to say hello in our QA chat: https://web.libera.chat/?settings=#libreoffice-qa Thank you for helping us make LibreOffice even better for everyone! Warm Regards, QA Team MassPing-UntouchedBug