diff --git a/vlib/toml/checker/checker.v b/vlib/toml/checker/checker.v index 15ae7ec675..8c3de263e8 100644 --- a/vlib/toml/checker/checker.v +++ b/vlib/toml/checker/checker.v @@ -491,7 +491,7 @@ fn (c &Checker) check_quoted_escapes(q ast.Quoted) ! { } } } - if next_ch in [`\t`, `\n`, ` `] { + if next_ch in [`\t`, `\r`, `\n`, ` `] { s.next() continue } diff --git a/vlib/toml/tests/quoted_string_crlf_test.v b/vlib/toml/tests/quoted_string_crlf_test.v new file mode 100644 index 0000000000..fffdbf0737 --- /dev/null +++ b/vlib/toml/tests/quoted_string_crlf_test.v @@ -0,0 +1,9 @@ +import toml + +fn test_quoted_string_crlf() { + toml_txt := 'str1 = """tcc \\\r\nabc \\\r\n123"""' + toml_doc := toml.parse_text(toml_txt) or { panic(err) } + + value := toml_doc.value('str1').string() + assert value == 'tcc abc 123' +}