Add string sanitization to property description

This commit is contained in:
Alexander Bock
2018-11-06 16:56:05 -05:00
parent 06426c01c2
commit 9dfb87e220
5 changed files with 86 additions and 14 deletions
+14 -2
View File
@@ -33,10 +33,22 @@ using json = nlohmann::json;
namespace openspace::properties {
namespace {
} // namespace
void to_json(json& j, const Property& p) {
std::string description = p.generateBaseJsonDescription();
json desc = json::parse(description);
std::string value = p.jsonValue();
json val = json::parse(value);
j = {
{ "Description", json::parse(p.generateBaseJsonDescription()) },
{ "Value", json::parse(p.jsonValue()) }
{ "Description", desc },
{ "Value", val }
};
j["Description"]["description"] = p.description();
}