jsreport / jsreport-docx

jsreport recipe rendering word docx
MIT License
10 stars 3 forks source link

Special characters not escaped #31

Closed jper92 closed 3 years ago

jper92 commented 3 years ago

Hi,

I have a project where our customers enter a text that then is passed to jsreport to generate a docx, the issue is that the payload we're passing seems like this:

{ "title": "A random text with a special character \u0000" }

And in the template we have something like this:

{{ title }}

The issue is that the generated docx is invalid, apparently the special characters won't be escaped and the office suites will fail to load: https://playground.jsreport.net/w/anon/NjdMzfBD

Should the library escape those characters so that the generation doesn't fail?

pofider commented 3 years ago

Thank you for this topic. We will take a deeper look and decide if the escape should be automatic or we should at least document how to do it.

bjrmatos commented 3 years ago

this should be fixed on master