Procházet zdrojové kódy

fix line breaks were not parsed correctly in json

Kolja Strohm před 1 rokem
rodič
revize
b4bfe2de89
1 změnil soubory, kde provedl 2 přidání a 0 odebrání
  1. 2 0
      JSON.cpp

+ 2 - 0
JSON.cpp

@@ -123,6 +123,7 @@ JSONString::JSONString(Text string)
 {
     this->string = string;
     string.ersetzen("\\\"", "\"");
+    string.ersetzen("\\n", "\n");
 }
 
 Text JSONString::getString() const
@@ -134,6 +135,7 @@ Text JSONString::toString() const
 {
     Text esc = string;
     esc.ersetzen("\"", "\\\"");
+    esc.ersetzen("\n", "\\n");
     return Text(Text("\"") += esc.getText()) += "\"";
 }