descriptions: fix bad json output (#11350)
--------- Co-authored-by: Mihai Fufezan <mihai@fufexan.net>
This commit is contained in:
parent
0c317f2508
commit
ec26b753a2
4 changed files with 42 additions and 6 deletions
|
|
@ -3210,8 +3210,8 @@ std::string SConfigOptionDescription::jsonify() const {
|
|||
"explicit": {})#",
|
||||
val.value, val.min, val.max, currentValue, EXPLICIT);
|
||||
} else if constexpr (std::is_same_v<T, SColorData>) {
|
||||
return std::format(R"#( "value": {},
|
||||
"current": {},
|
||||
return std::format(R"#( "value": "{}",
|
||||
"current": "{}",
|
||||
"explicit": {})#",
|
||||
val.color.getAsHex(), currentValue, EXPLICIT);
|
||||
} else if constexpr (std::is_same_v<T, SBoolData>) {
|
||||
|
|
@ -3220,7 +3220,7 @@ std::string SConfigOptionDescription::jsonify() const {
|
|||
"explicit": {})#",
|
||||
val.value, currentValue, EXPLICIT);
|
||||
} else if constexpr (std::is_same_v<T, SChoiceData>) {
|
||||
return std::format(R"#( "value": {},
|
||||
return std::format(R"#( "value": "{}",
|
||||
"firstIndex": {},
|
||||
"current": {},
|
||||
"explicit": {})#",
|
||||
|
|
@ -3257,7 +3257,7 @@ std::string SConfigOptionDescription::jsonify() const {
|
|||
{}
|
||||
}}
|
||||
}})#",
|
||||
value, description, (uint16_t)type, (uint32_t)flags, parseData());
|
||||
value, escapeJSONStrings(description), (uint16_t)type, (uint32_t)flags, parseData());
|
||||
|
||||
return json;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue