diff --git a/scripts/bundle.lua b/scripts/bundle.lua index 330ae7c575c068fd6cd9fe47594f7a805d933c51..e7d4fcfb4533c561f9b2c061e4cd32b86380d110 100755 --- a/scripts/bundle.lua +++ b/scripts/bundle.lua @@ -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) .. "["