fix: trim slashes (#2399)

This commit is contained in:
yetone
2025-07-03 00:30:58 +08:00
committed by GitHub
parent 46f3e77543
commit 17a1f83950

View File

@@ -572,7 +572,16 @@ end
function M.trim_slashes(text)
if not text then return text end
return text:gsub("//n", "/n"):gsub("//r", "/r"):gsub("//t", "/t"):gsub('/"', '"')
local res = text
:gsub("//n", "/n")
:gsub("//r", "/r")
:gsub("//t", "/t")
:gsub('/"', '"')
:gsub('\\"', '"')
:gsub("\\n", "\n")
:gsub("\\r", "\r")
:gsub("\\t", "\t")
return res
end
---@param original_lines string[]