Merge pull request #195 from infinikiller64/patch-1

Added :gsub("\\\n","\\n") to string serialization
This commit is contained in:
Florian Nücke 2014-04-03 11:52:35 +02:00
commit fca62946bf

View File

@ -28,7 +28,7 @@ function serialization.serialize(value, pretty)
return tostring(v) return tostring(v)
end end
elseif t == "string" then elseif t == "string" then
return string.format("%q", v) return string.format("%q", v):gsub("\\\n","\\n")
elseif t == "table" and pretty and getmetatable(v) and getmetatable(v).__tostring then elseif t == "table" and pretty and getmetatable(v) and getmetatable(v).__tostring then
return tostring(v) return tostring(v)
elseif t == "table" then elseif t == "table" then