Fixed the issue when reading or writing escaped JSON strings from and to LS.

This commit is contained in:
ruri
2019-04-20 14:29:04 +02:00
parent f88d80f27f
commit 29180b0165
2 changed files with 4 additions and 3 deletions
+1 -1
View File
@@ -67,7 +67,7 @@ namespace RuriLib.LS
public BlockWriter Literal(string literal, string property = "")
{
if (property != "" && CheckDefault(literal, property)) return this;
Write($"\"{literal.Replace("\"", "\\\"")}\" ");
Write($"\"{literal.Replace("\\", "\\\\").Replace("\"", "\\\"")}\" ");
return this;
}