* fix: patchDocument, looks for namspaces more carefully over whole document
added support of different placeholder brackets, default `{{`: `}}`
extended inputDataType to accept JSZip
* fix: Attribute value string not converted to HTML esc char by js2xml
original: https://github.com/nashwaan/xml-js/issues/142
* fix: skip processing utf-16 encoded files
* fix: patching goes on the second circle over patched document
added parameter `recursive`(= true by default) to be able to disable
this behavior
* Fix linting
* Simplify code
* write tests to skip UTF-16 types
---------
Co-authored-by: Vladimir Bulyga <vladimir.bulyga@legatics.com>
Co-authored-by: Dolan Miu <dolan_miu@hotmail.com>
* feat: Add ability to detect patches which are present in a file
* chore: export patchDetector function
* fix: Make sure we don't attempt to call toJson on binary content
---------
Co-authored-by: Christopher Fox <cfox@homebound.com>
* Turn patch document into options object
Add outputType to options
* Set keep styles to true by default
* Simplify method
* Rename variable
* #2267 Multiple patches of same key
* Remove path which won't be visited
There were scenarios in which patching a document would result in loss
of style for the template runs and, possibly, their right-adjacent run
as well (post-splitting). That was due to the run style elements not
being added to the newly created runs.
This commit addresses this issue by introducing a new, optional, flag
for the `patchDocument` function: `keepOriginalStyles`. It defaults to
`false` (current behavior) and, when `true`, ensures that there is no
loss of styling.
This should address https://github.com/dolanmiu/docx/issues/2293.