Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Double pipe character in data causes corruption #375

Open
MattCrum1 opened this issue Jul 12, 2024 · 1 comment
Open

Double pipe character in data causes corruption #375

MattCrum1 opened this issue Jul 12, 2024 · 1 comment
Labels

Comments

@MattCrum1
Copy link

I have a fairly simple document template with a for loop, using INS to write into the document for each element in a JSON array.

Works fine - until my incoming JSON data includes a double pipe character "||" in a value.

The docx-templates function completes with no errors and the Word document is created, but it is corrupted and cannot be opened in Word. Tried opening it in a text editor and it says that the docx file is unreadable/binary data.

Guessing the docx-templates function is reading || as an OR switch and halting after processing that element of the array - is there any additional logging that I can enable to prove this? Do you know of a function switch that will allow literal "||" to be printed into the Word document - or do I need to escape it somehow?

Thanks in advance

@jjhbw
Copy link
Collaborator

jjhbw commented Jul 13, 2024

Can you provide a MRE? Any || present in strings that you feed to the INS commands should not be interpreted as javascript in normal cases.

@jjhbw jjhbw added the triage label Jul 13, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants