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
For some reason (maybe copy & paste), we ended up with a text field containing \u0002 char (Start of Text), and this broke document generation with Sablon
That's unfortunate and annoying to debug for sure. Assuming all characters that we strip do indeed cause the generated document to be broken, I see no drawbacks in using some defensive sanitization directly in Sablon.
Conceptually, It be better if we can sanitize in Sablon::Content than the insertion. That would also allow some more flexible behavior if someone wanted a different kind of sanitization for Strings for example. It might be a bit more involving to add it to Content though as we might need to sanitize in multiple places.
For some reason (maybe copy & paste), we ended up with a text field containing
\u0002
char (Start of Text), and this broke document generation with SablonMinimum reproducible test case
cv template is the same file as: https://github.com/senny/sablon/blob/master/test/fixtures/cv_template.docx
This is a problem with unicode chars from 1 (
0001
) to 31 (001F
) except, without surprises, for:0009
000a
000d
Expected output
The template without content
Actual output
An empty file
Workarounds
I've tried
Sablon.content(:string, "\u0002")
without success.Sanitizing the input will work, but there is always the chance to forget a field, so I was wondering if this can be fixed in Sablon itself
The text was updated successfully, but these errors were encountered: