ParagraphFormat issues after removing bookmark content

Hello,

I’m having problems with ParagraphFormat after removing previous paragraph that was contained in bookmark. Please find the attached example application with input document, expected document and output document inside.

There are two paragraphs in the document having different formattings. The first paragraph is fully surrounded by bookmark, which means BookmarkEnd is a child node of Body. After I remove the bookmark and clear its contents (so remove the full first paragraph as a result), the remaining paragraph in resulting document has ParagraphFormat values (e.g. LineSpacing, SpaceAfter) from the deleted paragraph applied, instead of the ones it previously had.

This doesn’t seem to be the desired behaviour, as when deleting paragraphs in Word manually or with Aspose by doing just paragraph.Remove(), the next paragraph preserves its formatting.

Why is this happening?

ParagraphFormatTesting.zip (212.7 KB)

Thanks,
Anna

@acturisaspose

We have tested the scenario and have managed to reproduce the same issue at our side. For the sake of correction, we have logged this problem in our issue tracking system as WORDSNET-19767. You will be notified via this forum thread once this issue is resolved.

We apologize for your inconvenience.

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