-
Notifications
You must be signed in to change notification settings - Fork 146
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
Bug Report: option data with object keys as numbers does not work #388
Comments
The commands in the template are effectively javascript syntax. If you put literal numbers in a command, e.g The keys of the In light of the above, I'd say what you want to do is impossible currently. However, given that commands are essentially javascript, docx-templates supports all kinds of creative hacks. So maybe you can find something to solve your problem. |
In summary: |
Thank you for quick response! I think you should make a choice:
Because now it is not possible to understand why it happens without your clarifications. |
Option data with object keys as numbers does not work
Code to reproduce:
Template: FinalCertificateTemplate.docx
Result:
In the results file, keys 1 and 2 are not replaced.
If i do the same thing but with keys as strings, result will be correct
Code to reproduce:
Template: FinalCertificateTemplate.docx
Result:
In the results file, keys a and b are replaced.
For JavaScript objects keys is always strings, so it must be no difference.
Information about my stack:
I'm using Next.js version 14.2.4, with pure Node.js version 20.11.0 as the back-end. All the certificate generation logic is in the back-end part
The text was updated successfully, but these errors were encountered: