fix: more reliable remove_indentation (#2102)

This commit is contained in:
yetone
2025-05-30 12:55:15 +08:00
committed by GitHub
parent d44db10535
commit 22418bff8b

View File

@@ -576,7 +576,7 @@ end
--- remove indentation from code: spaces or tabs
function M.remove_indentation(code)
if not code then return code end
return code:gsub("^%s*", "")
return code:gsub("^%s*", ""):gsub("%s*$", "")
end
function M.relative_path(absolute)