html2openxml icon indicating copy to clipboard operation
html2openxml copied to clipboard

Unordered list is converted in ordered list

Open lacsyst opened this issue 6 years ago • 4 comments

All is in the title

When my html contains an unordered list, this list is converted to ordered list.

` using (WordprocessingDocument package = WordprocessingDocument.Create(generatedDocument, WordprocessingDocumentType.Document)) { MainDocumentPart mainPart = package.MainDocumentPart; if (mainPart == null) { mainPart = package.AddMainDocumentPart(); new Document(new Body()).Save(mainPart); }

                HtmlConverter converter = new HtmlConverter(mainPart);
                converter.ParseHtml(html);

                mainPart.Document.Save();
                docMainPart = mainPart;
            }

`

lacsyst avatar Aug 22 '19 14:08 lacsyst

In HtmlConverter.cs file the <ul> tag as the same Action element than <ol> tag (ProcessNumberingList)

{ "<ol>", ProcessNumberingList }, { "<p>", ProcessParagraph }, { "<pre>", ProcessPre }, { "<q>", ProcessQuote }, { "<span>", ProcessSpan }, { "<section>", ProcessDiv }, { "<s>", ProcessHtmlElement<Strike> }, { "<strike>", ProcessHtmlElement<Strike> }, { "<strong>", ProcessHtmlElement<Bold> }, { "<sub>", ProcessSubscript }, { "<sup>", ProcessSuperscript }, { "<table>", ProcessTable }, { "<tbody>", ProcessTablePart }, { "<td>", ProcessTableColumn }, { "<tfoot>", ProcessTablePart }, { "<th>", ProcessTableColumn }, { "<thead>", ProcessTablePart }, { "<tr>", ProcessTableRow }, { "<u>", ProcessUnderline }, { "<ul>", ProcessNumberingList },

lacsyst avatar Aug 27 '19 07:08 lacsyst

Hi. I'm having this same issue and have yet to find a solution.

Do you mind sharing your solution if you have one?

Thanks, Érica.

ericadcg avatar Oct 01 '20 15:10 ericadcg

I think this was solved already. I`m using the latest version and I can see differences between those two.

ricardodemauro avatar Aug 31 '22 17:08 ricardodemauro

I know I'm still having this issue. If there is a known way to ensure this works, I'd sure like to know, otherwise I'm going to keep trying to get a ListBullet to work.

I have multilevel lists with both Ordered and Unordered.

Archie-Miller avatar May 19 '23 19:05 Archie-Miller