[BUG] The |
character causes unnecessary quotation of the value
#787
Labels
|
character causes unnecessary quotation of the value
#787
Describe the bug
If the cell value includes the
|
character, the cell is unnecessarily quoted.Parsing or Formatting?
To Reproduce
Expected behavior
Printed in the console:
What I get instead is:
Desktop (please complete the following information):
Additional context
The reason for such behavior:
In the file
packages/format/src/formatter/FieldFormatter.ts
there is a line:The problem is with the ending characters of the regexp:
|\r|\n]
. Because it is inside the square brackets[]
, the|
characters don't have the meaning of alternation, but instead are treated as a single character in a character set.The resulting regexp from the default settings would be
/[,\n|\r|\n]/
, which would match an occurrence of any of the following characters:,
,\n
,|
,\r
.So to fix it, it should be enough to just delete those
|
characters from the set, as they are not needed there:I wanted to post this as a pull request, but I failed at building the project and running the tests. There are some errors, but honestly, I don't have the time or maybe even competence to track and fix them. I hope this issue is good enough.
The text was updated successfully, but these errors were encountered: