fix: escape original_content (#5)

This commit is contained in:
Hanchin Hsieh
2024-08-15 13:41:54 +08:00
committed by GitHub
parent 0b6a85ee64
commit 1634abb9cd
2 changed files with 5 additions and 0 deletions

View File

@@ -4,4 +4,8 @@ function M.trim_suffix(str, suffix)
return string.gsub(str, suffix .. "$", "")
end
function M.escape(str)
return string.gsub(str, "([%(%)%.%%%+%-%*%?%[%^%$%]])", "%%%1")
end
return M