How to strip a field while preserving quotes? #139
-
Hi @osiegmar I have more questions in the scope of junit-team/junit5#4339 🙂 Currently, when a field is stripped, whitespaces wrapped in quotes are preserved. Consider the following example, using single quotes as the quote character:
I wonder if it's possible to implement this using the available customization options. Using the |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 1 reply
-
Hi @vdmitrienko, That's a wonderful example of "malformed" data where it's hard to find consensus about the correct handling. As per RFC 4180, there is no such thing as whitespaces around quotes. record = field *(COMMA field)
field = (escaped / non-escaped)
escaped = DQUOTE *(TEXTDATA / COMMA / CR / LF / 2DQUOTE) DQUOTE
non-escaped = *TEXTDATA Currently, the parser removes (escaped) quotes within the field data before it is passed to the Some (not-yet-implemented) mechanism would be required to access raw data before the field modifiers are applied. Another thing that comes to mind that would have a greater impact: whitespaces BEFORE a quote, as this would cause the parser to (spec-conforming) read the data as an unquoted field including the quotes as regular characters. What is your expectation here? Best, Oliver |
Beta Was this translation helpful? Give feedback.
-
Transferred to #140 |
Beta Was this translation helpful? Give feedback.
Transferred to #140