Closed PatrickKelsch closed 3 weeks ago
@PatrickKelsch I tried to reproduce the issue but failed. In my case everything is OK:
using DocumentFormat.OpenXml.Packaging;
using HtmlToOpenXml;
namespace Html2Word
{
internal class Program
{
static void Main(string[] args)
{
var html = """
<ul style="list-style-type:disc"><li value="1" style="margin-top: 0px;margin-bottom: 12px;line-height: 1.15;font-family: 'Verdana';font-style: Normal;font-weight: normal;font-size: 16px;color: #000000;"><span style="font-family: 'Times New Roman';font-style: Normal;font-weight: normal;font-size: 12px;color: #000000;">test</span></li><li value="2" style="margin-top: 0px;margin-right: 0px;margin-bottom: 12px;line-height: 1.15;font-family: 'Verdana';font-style: Normal;font-weight: normal;font-size: 16px;color: #000000;"><span style="font-family: 'Times New Roman';font-style: Normal;font-weight: normal;font-size: 12px;color: #000000;">test2</span></li><li value="3" style="margin-top: 0px;margin-right: 0px;margin-bottom: 12px;line-height: 1.15;font-family: 'Verdana';font-style: Normal;font-weight: normal;font-size: 16px;color: #000000;"><span style="font-family: 'Times New Roman';font-style: Normal;font-weight: normal;font-size: 12px;color: #000000;">test3</span></li></ul><p style="margin-top: 0px;margin-right: 0px;margin-bottom: 12px;line-height: 1.15;"><span style="font-family: 'Times New Roman';font-style: Normal;font-weight: normal;font-size: 12px;color: #000000;"> </span></p><ol start="1" style="list-style-type:decimal"><li value="1" style="margin-top: 0px;margin-right: 0px;margin-bottom: 12px;line-height: 1.15;font-family: 'Verdana';font-style: Normal;font-weight: normal;font-size: 16px;color: #000000;"><span style="font-family: 'Times New Roman';font-style: Normal;font-weight: normal;font-size: 12px;color: #000000;">test4</span></li><li value="2" style="margin-top: 0px;margin-right: 0px;margin-bottom: 12px;line-height: 1.15;font-family: 'Verdana';font-style: Normal;font-weight: normal;font-size: 16px;color: #000000;"><span style="font-family: 'Times New Roman';font-style: Normal;font-weight: normal;font-size: 12px;color: #000000;">test5</span></li><li value="3" style="margin-top: 0px;margin-right: 0px;margin-bottom: 12px;line-height: 1.15;font-family: 'Verdana';font-style: Normal;font-weight: normal;font-size: 16px;color: #000000;"><span style="font-family: 'Times New Roman';font-style: Normal;font-weight: normal;font-size: 12px;color: #000000;">test6 </span></li></ol>
""";
using WordprocessingDocument package = WordprocessingDocument.Create(@"c:\temp\4\result2.docx", DocumentFormat.OpenXml.WordprocessingDocumentType.Document);
MainDocumentPart mainPart = package.MainDocumentPart ?? package.AddMainDocumentPart();
HtmlConverter converter = new(mainPart);
converter.ParseHtml(html);
package.Save();
}
}
}
The result:
I did a serious refactoring for v3 and have worked hard on numbering. Thanks for confirming this is working fine
Describe the bug
is displaying as numbered list in word and not using the bullet style specified. **Expected behavior** Should be able to convert UL and OL and have them display in word document like they do in HTML. ![image](https://github.com/onizet/html2openxml/assets/67358229/18dff621-5532-4921-9b66-46eb6810a2e4) However, in a word document they appear like this: ![image](https://github.com/onizet/html2openxml/assets/67358229/7edcebe4-926f-4b64-8d23-d705e01244aa) **Repro** HTML Below: `- test
- test2
- test3
- test4
- test5
- test6
`