Closed luizfbicalho closed 2 years ago
@luizfbicalho can you please explain why this change actually fix the issue? (it looks very magical 😁)
Or/better add simple test that reproduce this behavior without this change.
@luizfbicalho can you please explain why this change actually fix the issue? (it looks very magical 😁)
Or/better add simple test that reproduce this behavior without this change.
In some cases, there is one character in the middle of the replace that is a line break or a page break, and this character doesn't add 1 to the lenth of the string, this way the replaced string is one string smaller than the template string and when the replace happens, one ">" remains on the result document, I'll try to create a test here
Now I have different results in OpenXmlPowerTools and in Clippit correct.docx error.docx
But the clippit result in test doesn't have the > charactere in the error.docx any idea whats going on?
DA-TemplateMaior-processed-by-DocumentAssembler.docx
The test is the DA-templateMaior.docx and DA-templateMaior.xml, if you run them on old power tools you get the >
The element that I'm filtering is this
<r xmlns="http://schemas.openxmlformats.org/wordprocessingml/2006/main">
<lastRenderedPageBreak />
</r>
this element in this code has the Ch property as null or empty
var charsAndRuns = runsTrimmed
.Select(r => new { Ch = UnicodeMapper.RunToString(r), r })
//.Where(w => !string.IsNullOrEmpty(w.Ch))
.ToList();
but for some reason this element doesn't appear on the list.
This Is solved by the #58 PR
In some cases I have page breaks or line breaks between the assembly and I get this issue