Inserting HTML lists causes empty list entry

Hi,

when inserting HTML lists, empty list entries appear at the beginning of the inserted list since version 19.3 (also tested with version 19.7).

Steps to Reproduce
Using the following code:

DocumentBuilder builder = new DocumentBuilder();
List list = builder.getDocument().getLists().add(ListTemplate.BULLET_CIRCLE);
builder.getListFormat().setList(list);

builder.insertHtml("<ul><li>Item</li></ul>");
builder.getDocument().save(“result.docx”);

Version 19.2 or older:
In version 19.2, the first visible list entry in the document is the list item with text “Item”. The bullet point of the list item is not from type BULLET_CIRCLE but the default bullet point (filled circle).

Version 19.3 or newer:
In Version 19.3, the first visible list entry in the document is an empty list item with a bullet point of type BULLET_CIRCLE.
The second list item has the text “Item” with a default bullet point (filled circle).
html_list.zip (11.6 KB)

Why is an empty list item inserted at the top of the list only because the list format is set?

Best regards,
Ingo Gutzeit

@gutzeit,

We tested the scenario and have managed to reproduce the same problem on our end. For the sake of correction, we have logged this problem in our issue tracking system. The ID of this issue is WORDSNET-18968. We will further look into the details of this problem and will keep you updated on the status of correction. We apologize for your inconvenience.

Hi @awais.hafeez,

thank you very much for your quick response.

Best regards,
Ingo Gutzeit

The issues you have found earlier (filed as WORDSNET-18968) have been fixed in this Aspose.Words for .NET 21.3 update and this Aspose.Words for Java 21.3 update.

1 Like