code_builder icon indicating copy to clipboard operation
code_builder copied to clipboard

`literalString` \r\n(CRLF) causes an error

Open medz opened this issue 1 year ago • 0 comments

In literalString, if the EOL is CRLF it will cause incorrect code to be generated. I checked the source code and found that literalString only handles the \n LF case, but did not notice the commonly used \r\n CRLF under Windows.

Example 1:

literalString('a\r\nb\r\nc');

Outout:

a
\nb
\nc

example 2:

literalString('a\nb\nc');

Outout:

a\nb\nc

medz avatar Mar 28 '24 05:03 medz