Issue when converting from OneDrive Word doc to HTML

We’re looking into a feature for our customers involving an integration with OneDrive for the purposes of realtime collaborative editing of newsletters. When a newsletter is checked out, Aspose is used to convert its HTML into a word document, which is then uploaded to OneDrive via the MS Graph API. When changes are done, the file is checked in and converted back from the word document to HTML again.

For the most part, this has been working fine and pretty much all of the layout features OneDrive supports get converted successfully. But we’ve noticed one particular issue in relation to images and their text wrapping option. Whereas Word has a singular textwrap option labeled “Square”, OneDrive has two labeled “Square Left” and “Square Right”:

These options respectively move the image to the top-left and top-right of the paragraph. And Aspose actually seems to handle converting those back and forth from word doc to HTML pretty well. But there’s one particular case where it fails, and that’s when you have an image already set to dock to one side, and you want to change it to the other side (e.g. from “Square Left” to “Square Right”). Aspose seems to not register that change and it keeps it stuck on the original side when you check back in. However, we have found that you can fix it by changing the image to “In Line”, checking that in, checking it back out, and now changing it to the “Square Left/Right” setting you want.

It seems like some sort of information isn’t being updated when switching between the two square settings, but is when switching from a non-square setting. We’re having trouble figuring out how to manually correct this through code, though. Is there a good way to identify and fix this?

@Thomas.Coleman First of all, please note, Aspose.Words is designed to work with MS Word documents. HTML documents and MS Word documents object models are quite different and it is not always possible to provide 100% fidelity after conversion one format to another.
For testing I have created a simple DOCX document in OneDrive with pictures that have Square Left and Square Right position. You can identify such shapes using Shape.WrapType and Shape.HorizontalAlignment properties:

Document doc = new Document(@"C:\Temp\in.docx");
foreach (Shape s in doc.GetChildNodes(NodeType.Shape, true))
{
    Console.WriteLine(s.WrapType); // Returns "Square"
    Console.WriteLine(s.HorizontalAlignment); // Returns "Left/Right"
}

As I can see Aspose.Words preserves these settings in HTML like this:

<img src="out.001.png" width="480" height="189" alt="" style="margin-right:9pt; margin-left:9pt; -aw-left-pos:0pt; -aw-rel-hpos:column; -aw-rel-vpos:paragraph; -aw-top-pos:0pt; -aw-wrap-type:square; float:left; position:relative" />

and

<img src="out.001.png" width="480" height="189" alt="" style="margin-right:9pt; margin-left:9pt; -aw-left-pos:0pt; -aw-rel-hpos:column; -aw-rel-vpos:paragraph; -aw-top-pos:0pt; -aw-wrap-type:square; float:right; position:relative" />

After playing around with it a bit more, it actually seems to be an issue with OneDrive itself (the same issue occurs if you just download + reupload the word document through OneDrive without ever touching Aspose at all), so I don’t think Aspose can do anything about it.

@Thomas.Coleman It is perfect that you managed to isolate the issue. Please feel free to ask in case of any issues, we are always glad to help you.