docx-merger
docx-merger copied to clipboard
The numbered list continues instead of resetting on the next page of merged documents.
I have four one-page documents which have a simple numbered list like this:
- Item
- Item
- Item
- Item
- Item
I'm merging these documents into one, and the merged document has four pages, which is fine. However, the numbered list continues to increase on each merged page instead of resetting and starting from 1 again on each page as shown above. I tried to manipulate the DOM in index.js by updating the numId value and creating an appropriate number schema in the prepareNumbering function, then injecting that into the numbering XML. This works in LibreOffice but not in MS Office. When I manipulate the DOM and then use XMLSerializer to serialize the DOM to a string and pass it to the insertRaw function, the document is corrupted, but only in MS Office. I would be thankful for any hints on how to fix this.
PS. Great job! Besides this issue, it works like a charm.