Closed null-dev closed 2 years ago
Nevermind, the example I linked actually does unescaping: https://github.com/changhe3/nom-json-parser/blob/cce34f560f394cdf1601ab9c5c2fd012eb405084/src/utils.rs#L73
So it should be possible to drop that into this project.
Currently the parser doesn't auto-unescape strings (e.g.
"\\"
gets parsed to:r#"\\"#
when it should actually be parsed to:r#"\"#
).Same regarding unicode escape sequences, e.g.:
"\uD834"
.There's an example here that is able to properly validate unicode escape sequences: https://github.com/changhe3/nom-json-parser/blob/cce34f560f394cdf1601ab9c5c2fd012eb405084/src/parser.rs#L132 but it doesn't do any auto-unescaping.