camunda / feel-scala

FEEL parser and interpreter written in Scala
https://camunda.github.io/feel-scala/
Apache License 2.0
120 stars 49 forks source link

Newline characters should not be escaped #701

Closed saig0 closed 8 months ago

saig0 commented 11 months ago

Describe the bug If a string literal contains a newline character \n, the newline is escaped and returned as \\n.

"Hello\nWorld"
// "Hello\\nWorld"

The behavior is different if the newline character is stored in a string variable and the variable is referenced in the expression. In this case, the newline is not escaped.

x
// "Hello\nWorld"

To Reproduce Steps to reproduce the behavior:

  1. Evaluate the expression "Hello\nWorld"
  2. Verify that the newline character is escaped

Expected behavior A newline character in a string literal is not escaped. The string is returned in its original form.

"Hello\nWorld"
// "Hello\nWorld"

Environment