Doc2Html - Export of bullet list contains unexpected font-family attribute


when exporting simple word documents containing text in standard style and a bullet list also based on standard style to HTML, the bullet list items get extra <span class="font-family: Arial;"> tags.

<!DOCTYPE html>
<html lang="de-DE">
    <meta charset="UTF-8" />
    <meta name="generator" content="Aspose.Words for Java 23.4.0" />
<body style="font-family:Arial; font-size:10pt">
        <p style="margin-top:0pt; margin-bottom:0pt">
            <span>This is text in standard format style.</span>
        <ul style="margin:0pt; padding-left:0pt">
            <li style="margin-left:26.56pt; padding-left:9.44pt; font-family:serif; -aw-font-family:'Symbol'; -aw-font-weight:normal; -aw-number-format:''">
                <span style="font-family:Arial">This is a bullet list item based on standard style.</span>

It looks like a bug to me, but maybe it’s the expected behavior. If it’s the latter one, is there a possibility to disable this feature?

The problem here is, that if you re-insert this HTML snippet in an other word document using DocumentBuilder.insertHtml(…) and this document has a different base font, the bullet list items still have their Arial font.
We are using the HTML export within a WYSIWYG editor to let the user modify the snippet, therefore we cannot insert the original word document directly with DocumentBuilder.insertDocument(…).

Thanks for your help!

Best regards,

test.docx (14.9 KB)

We have opened the following new ticket(s) in our internal issue tracking system and will deliver their fixes according to the terms mentioned in Free Support Policies.

Issue ID(s): WORDSNET-25364

You can obtain Paid Support Services if you need support on a priority basis, along with the direct access to our Paid Support management team.

Thank you!

I forgot to say, that also the “font-family:serif” CSS attribute should be removed from the list item tag in order to work properly.

@andreas.gerasch Have you tried loading HTML document into Document instance and then inserting it using DocumentBuilder.insertDocument method instead of inserting using DocumentBuilder.insertHtml this might help to resolve the issue.
Also, you should note that MS Word and HTML formats are quite different and it is impossible to provide 100% fidelity after converting one to another.

@andreas.gerasch We have completed analysis of the issue and concluded the issue is not a bug.
The input document contains a list item with a text. HTML writer writes the font family for the span inside the list item since the list item has the another font family.

<li style="font-family:serif;">
    <span style="font-family:Calibri">This is a bullet list item based on standard style.</span>

We always write serif as the font family for the bullet list item. We are going to close the issue as not a bug.

The issues you have found earlier (filed as WORDSNET-25364) have been fixed in this Aspose.Words for Java 23.7 update.