Skip to content

Commit

Permalink
toml: Don't escape when not necessary in multiline strings
Browse files Browse the repository at this point in the history
  • Loading branch information
TheElectronWill committed May 26, 2024
1 parent efdbe4a commit 1a481ba
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ static void writeBasicMultiline(String str, CharacterOutput output, TomlWriter w
output.write(ESCAPED_BACKSLASH);
break;
default: {
if (Toml.isControlChar(c)) {
if (c != '\t' && c != '\n' && c != '\r' && Toml.isControlChar(c)) {
output.write(escapeUnicode(c));
} else {
output.write(Character.toChars(c));
Expand Down
2 changes: 1 addition & 1 deletion toml/test.toml
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ binary = 0b101011
[[ array . ofTables ]]
a = false
[[array.ofTables]]
a = [,]# This is an empty array
a = [1,2,]# trailing comma
[[array.ofTables]]
a = true

Expand Down

0 comments on commit 1a481ba

Please sign in to comment.