mirror of
https://github.com/MindWorkAI/AI-Studio.git
synced 2026-10-15 03:13:48 +00:00
Refactor Lua string escaping to a new utility class
This commit is contained in:
2 files changed
+10
-6
No files matched your search
@@ -69,12 +69,6 @@ public sealed partial class CollectI18NKeysCommand
|
||||
|
||||
Console.WriteLine(" done.");
|
||||
}
|
||||
|
||||
private static string EscapeLuaString(string value)
|
||||
{
|
||||
// Ersetze Backslash und Doppel-Anführungszeichen
|
||||
return value.Replace("\\", @"\\").Replace("\"", "\\\"");
|
||||
}
|
||||
|
||||
private string ExportToLuaAssignments(Dictionary<string, string> keyValuePairs)
|
||||
{
|
||||
|
||||
@@ -0,0 +1,10 @@
|
||||
namespace SharedTools;
|
||||
|
||||
public static class LuaTools
|
||||
{
|
||||
public static string EscapeLuaString(string value)
|
||||
{
|
||||
// Replace backslashes with double backslashes and escape double quotes:
|
||||
return value.Replace("\\", @"\\").Replace("\"", "\\\"");
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user