You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
because patchDocument catches all errors, the merge continues and future runs on the same paragraph use the incorrect split-token.
I think there are three problems to be addressed:
the code for detecting when all patches are found is masking all unintended errors. This should be communicated in the returned value, not an error.
the replacer should handle empty Runs.
there should be an option for controlling the white-space TextRun({ space: "preserve", text: "..." }) EDIT: I mistakenly thought the w:t was missing due to the formatter
This issue does not occur when:
keepOriginalStyles is off
we instantiate the Run with a string argument (new TextRun("...")), since that will run through a different code path in the constructor.
The text was updated successfully, but these errors were encountered:
I encountered weird results when using the document replacer:
SPLIT_TOKEN
(ɵ) appeared in the final document.The following seems to be happening:
new TextRun("")
), the TextRun doesn't contain aText
child.SPLIT_TOKEN
, and then crashes when trying to access the now missingelements
property here: https://github.com/dolanmiu/docx/blob/c6bb2556419f49f0ea42e774a20f5fa5f7450350/src/patcher/replacer.ts#L70C1-L74C1patchDocument
catches all errors, the merge continues and future runs on the same paragraph use the incorrect split-token.I think there are three problems to be addressed:
replacer
should handle empty Runs.there should be an option for controlling the white-spaceEDIT: I mistakenly thought theTextRun({ space: "preserve", text: "..." })
w:t
was missing due to the formatterThis issue does not occur when:
keepOriginalStyles
is offnew TextRun("...")
), since that will run through a different code path in the constructor.The text was updated successfully, but these errors were encountered: