We're sorry Aspose doesn't work properply without JavaScript enabled.

Free Support Forum - aspose.com

List numbers are incorrect after DOCX to HTML conversion using Java

Hello
I have a word document (docx) with a mutilevel list minimal.zip (10.3 KB), numbered in this way:

1 Par 1
1.1 Par 1.1
1.2 Par 1.2
2 Par 2
2.1 Par 2.1
2.2 Par 2.2

When exporting it to html using the option ExportListLabels.BY_HTML_TAGS, firefox displays it incorrectly:

1 Par 1
1.1 Par 1.1
1.2 Par 1.2
4 Par 2
2.1 Par 2.1
2.2 Par 2.2

While other browsers like chrome or edge display it correctly
the html/css generated by aspose looks like http://jsfiddle.net/wdhfay5c/1/ (I have removed unnecessary styles to make the output easier to understand)

By digging deeper into this topic we found a similar bug reported to mozilla https://bugzilla.mozilla.org/show_bug.cgi?id=1548753
To sum up they said that their solution is conform to css-spec and it is not their fault (spec: https://drafts.csswg.org/css-lists-3/#nested-counters)

I wonder if Aspose team could come up with a solution conform to the spec (using counters instead of counter for example or resetting implicit counter list-item each time we reset a custom counter generated by Aspose for example: http://jsfiddle.net/r8xzdyhc/)

@mohamed_hamdi

We suggest you please use the value of HtmlSaveOptions.ExportListLabels property as ExportListLabels.AS_INLINE_TEXT to get the desired output. Hope this helps you.

We have logged this issue as WORDSNET-20923 in our issue tracking system. After investigation, we will let you know either it is Aspose.Words’ bug or Firefox.

FYI: ExportListLabels.AS_INLINE_TEXT is the current option we use: but since we allow our users to modify documents, it would be better to use true html lists (so they could easily add/remove new items to the list)

@mohamed_hamdi

Thanks for sharing the detail. We will inform you via this forum thread once there is an update available on this issue.

Any updates ?

@mohamed_hamdi

Unfortunately, there is no update available on this issue at the moment. We will inform you via this forum thread once this issue is resolved.