fix: escape double quotes in share module serialize

- The serialize() function didn't escape " in string values, causing exports to be invalid Lua whenever a value contained double quotes (e.g. clickcast macros like CastSpellByName("Nature's Swiftness")). This made the Import button stay red with no error message.
This commit is contained in:
Meow
2026-03-03 23:10:55 +01:00
parent 8ae34d052d
commit 6577b3c8d9
+4 -2
View File
@@ -15,7 +15,9 @@ pfUI:RegisterModule("share", "vanilla:tbc", function ()
end
elseif type(v) == "string" then
match = true
str = str .. spacing .. " [\""..k.."\"] = \"".. string.gsub(v, "\\", "\\\\") .."\",\n"
local escaped = string.gsub(v, "\\", "\\\\")
escaped = string.gsub(escaped, "\"", "\\\"")
str = str .. spacing .. " [\""..k.."\"] = \"".. escaped .."\",\n"
elseif type(v) == "number" then
match = true
str = str .. spacing .. " [\""..k.."\"] = ".. string.gsub(v, "\\", "\\\\") ..",\n"
@@ -446,4 +448,4 @@ pfUI:RegisterModule("share", "vanilla:tbc", function ()
f:Show()
end
end
end)
end)