We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
The JSON emitter does not seem to be escaping control characters, like newlines. For example, with this code:
#include <stdio.h> #include <string> #include <ryml_all.hpp> int main() { char yml_buf[] = R"( foo: 1 bar: [2, 3] john: doe comment: | abc def )"; ryml::Tree tree1 = ryml::parse_in_place(yml_buf); auto s = ryml::emitrs_json<std::string>(tree1); printf("%s\n", s.c_str()); }
I get this output:
{"foo": 1,"bar": [2,3],"john": "doe","comment": "abc def "}
The newline in the "comment" property should have been converted to a \n.
\n
The text was updated successfully, but these errors were encountered:
[fix] json emitter should escape control characters
69cb0e4
re #297
2eb72db
Successfully merging a pull request may close this issue.
The JSON emitter does not seem to be escaping control characters, like newlines. For example, with this code:
I get this output:
The newline in the "comment" property should have been converted to a
\n
.The text was updated successfully, but these errors were encountered: