🐛 proper JSON Pointer escape in diagnostic messages

This commit is contained in:
Niels Lohmann committed 2021-01-16 15:33:05 +01:00
1 parent 7633a21e6c
commit e9d641130d
5 files changed
+252 -199

No files matched your search

+2 -1
View File
@@ -3,6 +3,7 @@
#include <string>
#include <vector>
#include <nlohmann/detail/value_t.hpp>
#include <nlohmann/detail/string_escape.hpp>
namespace nlohmann
{
@@ -70,7 +71,7 @@ class diagnostics_t
return "(" + std::accumulate(tokens.rbegin(), tokens.rend(), std::string{},
[](const std::string & a, const std::string & b)
{
return a + "/" + b;
return a + "/" + detail::escape(b);
}) + ") ";
#else
return "";