carboneio / carbone

Fast and simple report generator, from JSON to pdf, xslx, docx, odt...
https://carbone.io
Other
1.3k stars 190 forks source link

[Bug Report]: Result of render for word document is corrupted if array tags for different fields are used successively #215

Closed pmark019 closed 2 months ago

pmark019 commented 2 months ago

Environment Carbone Version: "carbone": "^3.5.6", Node Version: [e.g. Node 8.16.1] Browsers: Version 126.0.6478.127 (Official Build) (64-bit) Desktop OS: Windows 11 Other: Version: 24.2.5.2 (X86_64) / LibreOffice Community

Expected Behaviour Word is opened successfully without issues

Actual Behaviour Word cannot be opened

Steps to reproduce Steps to reproduce the bug:

  1. Create a docx template with arrays that are successive it should be one ranged (item) and another single (anotherItem)

    {d.item[i].text} {d.item[i+1].text} {d.anotherItem[i].text}

  2. Render doc

  3. See error image

If {d.anotherItem[i].text} is not included or placed after a different tag that is not an array, everything works fine.