Nested enumerations are not handled correctly

Hello support,

we encounter issues with nested enumerations when converting Outlook e-mails to HTML.

Please see the attached examples, showing that nested enumerations are not ending up as they should:

Screenshot of e-mail in Outlook
Screenshot of result

So the HTML ends up like this:

<ol>...</ol>
<ul>...</ul>
<ol>...</ol>
...

instead of:

<ol>
  <li>...
    <ul>...</ul>
  </li>
  <li>....</li>
  ....
</ol>

Test e-mail

The code we use for the conversion to HTML:

     final MsgLoadOptions loadOptions = new MsgLoadOptions();
     loadOptions.setPrefferedTextEncoding(Charsets.UTF_8);
     MailMessage mailMessage = MailMessage.load(inputStream, loadOptions);
     mailMessage = removeSignature(mailMessage);
     HtmlSaveOptions saveOption = SaveOptions.getDefaultHtml();
     saveOption.setCheckBodyContentEncoding(true);
     mailMessage.save(outputStream, saveOptions);

We tested it with the latest version of Aspose e-mail for Java.

I will create a paid support ticket as well, referencing this one.

Kind regards, Stefan

Hello @stefan.raubal,
We have opened the following new ticket in our internal issue tracking system:

Issue ID(s): EMAILJAVA-35145

Thank you.

Hello @stefan.raubal

We have tested the code you provided, but cannot reproduce the issue.

(we used our removeSignature function)

if (mailMessage.isSigned())
    mailMessage = mailMessage.removeSignature();

Generated HTML renders correctly in Chrome, Edge, Firefox, IE.
Generated HTML (2.1 KB)
Screenshot of result (1.3 KB)

We have exported the original MSG to HTML using Outlook.
Save as with Outlook (9.6 KB)
The HTML file structure converted from Outlook is similar to the structure generated by Aspose.
Could you provide more information to reproduce the issue?

=== Outlook ===

<ol style='margin-top:0in' start=1 type=1>
 <li class=MsoListParagraph style='margin-left:0in;mso-list:l3 level1 lfo1'><span
     lang=EN-US style='mso-fareast-font-family:"Times New Roman";mso-ansi-language:
     EN-US'>Test</span></li>
</ol>

<ul style='margin-top:0in' type=disc>
 <li class=MsoListParagraph style='margin-left:.25in;mso-list:l2 level1 lfo2'><span
     lang=EN-US style='mso-fareast-font-family:"Times New Roman";mso-ansi-language:
     EN-US'>asdf</span></li>
 <li class=MsoListParagraph style='margin-left:.25in;mso-list:l2 level1 lfo2'><span
     lang=EN-US style='mso-fareast-font-family:"Times New Roman";mso-ansi-language:
     EN-US'>asdf</span></li>
</ul>

=== Aspose ===

<ol style="margin-top:0in" start="1" type="1">
   <li class="MsoListParagraph" style="margin-left:0in;mso-list:l3 level1 lfo1">
      <span lang="EN-US">
         Test 
      </span>
   </li>
</ol>

<ul style="margin-top:0in" type="disc">
   <li class="MsoListParagraph" style="margin-left:.25in;mso-list:l2 level1 lfo2">
      <span lang="EN-US">
         asdf
      </span>
   </li>
   <li class="MsoListParagraph" style="margin-left:.25in;mso-list:l2 level1 lfo2">
      <span lang="EN-US">
         asdf
      </span>
   </li>
</ul>

Hello @sergey.vivsiuk,

thank you for your quick response!

I have to do further research why this is not rendered correctly on our side.

Kind regards, Stefan

Thank you for this quick investigation, it turned out due to our sanitizing of the HTML we removed the required attributes from the HTML that set the starting number.

Your software does what it should!

@stefan.raubal
Thank you for this information. We are always ready to help.