I am searching for solution of this problem almost 3 days already. I have a Word document with placeholders. And we have our own implementation of how to parse word document templates and replace placeholders with content. But I ran into a problem, that Paragraph list doesn't contain all of the contents from word document. I am getting all Paragraph type descendants of OpenXmlPartRootElement.
var paragraphs = document.Descendants().OfType<Paragraph>().ToList();
Then I am checking for specific placeholder.
paragraphs.Count(x => x.InnerText.Contains("some placeholder"));
There's 3 same placeholders in document, but this statement finds only two of them. This corrupts all document and it is half parsed because of this.
Placeholders and texts in Word document are stored in a table.
Is it sort of bug in library or should I consider getting content in a different way?