Free Support Forum - aspose.com

Splits word using SPAN (event after JoinRunsWithSameFormatting)

Hello, I have an issue with world splitting while converting .docx in HTML.
doc.zip (27.0 KB)
when I try to convert this document, I end up with split words in the final list

<li class="ListParagraph" style="margin-left:31.35pt; padding-left:4.65pt">
					<span>Test </span>
					<span>li</span>
					<span>ste</span>
					<span> brb</span>
				</li>

I found some topics where you suggest to use JoinRunsWithSameFormatting() method but it still split the words, just in a different way

<li class="ListParagraph" style="margin-left:31.35pt; padding-left:4.65pt">
					<span>Test li</span>
					<span>ste brb</span>
				</li>

I tried to chain 2 call of JoinRunsWithSameFormatting, just in case, the second returned 0.

I’m using Aspose.Words v18.5.0.0

can you help me, please?

@brbardin,

After an initial test with the licensed latest (20.11) version of Aspose.Words for .NET, we were unable to reproduce this issue on our end. We used the following simple C# code to convert your DOCX to HTML format on our end:

Document doc = new Document("C:\\Temp\\doc\\USAID - Format Template 1.33 RS_Styles needed.docx");
doc.JoinRunsWithSameFormatting();
HtmlSaveOptions htmlSaveOptions = new HtmlSaveOptions(SaveFormat.Html);
htmlSaveOptions.PrettyFormat = true;
doc.Save("C:\\temp\\doc\\20.11 - JoinRunsWithSameFormatting.html", htmlSaveOptions);

Attachment: 20.11 - JoinRunsWithSameFormatting.zip (11.1 KB)

So, we suggest you to please upgrade to the latest version of Aspose.Words for .NET.

Thanks for the quick answer.