@@ -40,12 +40,14 @@ local function file_exists(path)
return false
end
---- Escape string for embedding in Lua long string
+--- Determine appropriate long string delimiters for embedding
---@param s string
----@return string
+---@return string open delimiter
+---@return string close delimiter
+---@return string content (unchanged)
local function escape_for_longstring(s)
local level = 0
- while s:find("%]" .. string.rep("=", level) .. "%]", 1, true) do
+ while s:find("]" .. string.rep("=", level) .. "]", 1, true) do
level = level + 1
end
local open = "[" .. string.rep("=", level) .. "["