List-style-type in counter() not being respected in HTML to Docx conversion

I’m having an issue getting the HTML file I am generating to maintain proper formatting when uses Aspose.Words Java to save the html as .doc or .docx. I’m wanting to add the ability to put () around my numbers and I have that working as expected and my HTML outputs correctly, but when I save it through Aspose to output my content as a document it is setting all the list styles to default numeric characters. So I get the () around the expected list item and the numbers increment correctly but it seems to be ignoring the passed in style to the function during file saving. I have attached the HTML and the DOCX file after conversion and you can see I am losing the Alpha characters and it is reverting all to numbers.

HTML OUTPUT:
image.png (4.8 KB)

DOCX After Save through Aspose
image.png (1.7 KB)

HTML CODE:

body {
	font-family: Times New Roman;
	font-size: 11pt;
	line-height: 11pt;
	counter-reset:upperAlpha;
	counter-reset:number;
	counter-reset:upperAlphaParen;
	counter-reset:lowerRoman;
}
						
ol li {
	list-style: none;
	position: relative;
}
				
				
ol.upperAlpha {
	counter-reset:upperAlpha;
	font-weight: bold;
	margin-top: 0pt;
	margin-bottom: 0pt;
}
ol.upperAlpha > li:before {
	counter-increment: upperAlpha;
	content: counter(upperAlpha, upper-alpha) ". ";
}
ol.number {
	counter-reset:number;
	font-weight: bold;
	margin-top: 0pt;
	margin-bottom: 0pt;
}
ol.number > li:before {
	counter-increment: number;
	content: counter(number, decimal) ". ";
}

ol.upperAlphaParen {
	counter-reset:upperAlphaParen;
	font-weight: bold;
	margin-top: 0pt;
	margin-bottom: 0pt;
}
ol.upperAlphaParen > li:before {
	counter-increment: upperAlphaParen;
	content: "(" counter(upperAlphaParen, upper-alpha) ") ";
}

I have also tried running this HTML file through your online HTML to WORD conversion tool and get the same results. I am getting an error there though when trying to pick the PDF format to save it to, but outputs Doc and Docx fine outside of the changing of these list values. Any assistance you can give on this would be appreciated as we need to have the () for legal reason in the document for the numbering so resolving this issue is of high importance.

Regards,
Jeremy

ComparisonFiles.zip (201.0 KB)

@AurinBlackstaff Thank you for reporting this problem to us. It has been logged as WORDSNET-23647. We will keep you informed and let you know once it is resolved or we have information for you.
Also, I have tested conversion to PDF and the document is converted without exceptions with the latest 22.3 version of Aspose.Words.

Not sure if I can add this here or if I should submit a seperate inquiry, but another issue we have come across with converting from HTML to Docx is the lose of underlining of our blank text.
Here is the HTML output that looks like the following

<li>
      <span class='normal'>Plan Number: <span style="white-space:pre;text-decoration:underline;font-weight: bold;">          </span></span>
</li>

After converting to doc, it looks like the following

Where if there is nothing after the underlined spaces, the underline is stripped out. You can see with the Paragraph notation on it is showing the series of spaces still post conversion, but is not honoring the underline style anymore. It is funny cause it still holds the Bold formatting. If there is any text afterward it works fine, but if it is the last thing on a line of text it doesn’t honor it. We were using a series of NBSP which worked but would prefer to use the white-space feature as we have a lot of these instances where if there is no value for the question we want to output the underlined space.

Let me know if you needed anything from me on this or if I should submit a different question for it.

@AurinBlackstaff Thank you for reporting this problem to us. I have managed to reproduce it on my side. For a sake of correction it has been logged as WORDSNET-23712. We will be sure to inform you once the issue is resolved.

@AurinBlackstaff We have completed analyzing the issue and concluded it is not a bug. By default, MS Word doesn’t underline trailing whitespace but this behavior can be changed in layout options:

This option can be enabled programmatically after loading HTML:

Document doc = new Document("in.html");
doc.CompatibilityOptions.UlTrailSpace = true;
doc.Save("out.docx");

I’m just following up on the WORDSNET-23647 bug that I reported on Mar. 25th. I see Status : Postponed and wondering if you have a possible ETA on when the fix for that may be coming as I’ve seen a few updates since then come out. For outputting the legal documents that we generate we need to be able to use the () around the list numbering content. Any update would be appreciated.

Regards,
Jeremy

@AurinBlackstaff Unfortunately, the issue has been postponed tile later date and is not yet scheduled for development. So currently we cannot provide you and estimate. We will keep you updated and let you know once the issue is resolved or we have more information for your.

The issues you have found earlier (filed as WORDSNET-23647) have been fixed in this Aspose.Words for .NET 22.10 update also available on NuGet.