Add centralized escaping of JSON strings

Enable correct escaping of " character thus removing the need to outlaw "s in comments
This commit is contained in:
Alexander Bock
2017-07-14 16:58:18 -04:00
parent 88b8789336
commit 6f524f4a67
6 changed files with 48 additions and 34 deletions
+1 -1
View File
@@ -124,7 +124,7 @@ std::string KeyBindingManager::generateJson() const {
json << "\"key\": \"" << std::to_string(p.first) << "\",";
json << "\"script\": \"" << p.second.command << "\",";
json << "\"remoteScripting\": " << (p.second.synchronization ? "true," : "false,");
json << "\"documentation\": \"" << p.second.documentation << "\"";
json << "\"documentation\": \"" << escapedJson(p.second.documentation) << "\"";
json << "}";
}
json << "]";