urvin-compliance/caracal

\r in table cell content brakes the table

ViktorKopychko opened this issue · 2 comments

Probably not a big deal but still
docx.table([["te\rst", "test", "te\nst"]]) produces
image

Truthfully, I've been on *nix systems so long now that I haven't seen a carriage return in the wild in a really long time. How would you propose Caracal handle CRs? Strip them? Convert them to line feeds? Something else?

Also, I thought Windows always followed a CR with a LF? Does MSWord have the same rendering issue if you supply the string "te\r\nst"?

(Note: I'm assuming that the issue here is how MSWord renders the Caracal document's markup when the markup contains a lone CR in a table cell, not that Caracal is writing crazy OOXML when it encounters a carriage return.)

\r\n produces the same behaviour.
I don't know should the library do something about it as the user can easily filter his data the way he wants (probably just remove \r).

Mostly I wanted to notify the people about it because I've encountered the following example and was really confused:

docx.table([["test", "te\r\nst", "test"]])

image