OfficeDev / Open-Xml-PowerTools

MIT License
692 stars 26 forks source link

Markupsimplifier does not simplify when only settings.RemoveSoftHyphens or settings.RemoveLastRenderedPageBreak is set #230

Closed lookilook closed 5 years ago

lookilook commented 6 years ago

Markupsimplifier does not simplify when only settings.RemoveSoftHyphens or settings.RemoveLastRenderedPageBreak is set to true. When one of the other Settings is true too then it does remove softhypens or LastRenderedPageBreak. my suggestion for solution: in MarkupSimplifier.cs -> SimplifyMarkupForPart add the following 2 lines in the If Statement beginning in line 561 settings.RemoveSoftHyphens || settings.RemoveLastRenderedPageBreak ||

current code: var prevNewRoot = new XDocument(newRoot); while (true) { if (settings.RemoveComments || settings.RemoveEndAndFootNotes || settings.ReplaceTabsWithSpaces || settings.RemoveFieldCodes || settings.RemovePermissions || settings.RemoveProof || settings.RemoveBookmarks || settings.RemoveWebHidden || settings.RemoveGoBackBookmark || settings.RemoveHyperlinks) newRoot = (XElement) SimplifyMarkupTransform(newRoot, settings, parameters);

tomjebo commented 5 years ago

Closing all issues as this repo is being archived and will no longer be maintained by Microsoft. The project is licensed for continued use and development by forking to your own repo.