mirror of
https://github.com/MindWorkAI/AI-Studio.git
synced 2025-04-27 23:59:48 +00:00
Refactor Lua string escaping to a new utility class
This commit is contained in:
parent
3e31d0a6d1
commit
eba3e7a9fe
@ -70,12 +70,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)
|
||||
{
|
||||
var sb = new StringBuilder();
|
||||
|
10
app/SharedTools/LuaTools.cs
Normal file
10
app/SharedTools/LuaTools.cs
Normal file
@ -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("\"", "\\\"");
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue
Block a user