From a0adb2a9c6ac7c7d0364de7823f5ba842b27b46d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Alvaro=20Mu=C3=B1oz?= Date: Wed, 25 Sep 2024 23:07:54 +0200 Subject: [PATCH] fix: remove escape_char since we are now using """ quoted strings --- lua/octo/gh/graphql.lua | 18 +++--------------- 1 file changed, 3 insertions(+), 15 deletions(-) diff --git a/lua/octo/gh/graphql.lua b/lua/octo/gh/graphql.lua index 4099fed4..e8f89e33 100644 --- a/lua/octo/gh/graphql.lua +++ b/lua/octo/gh/graphql.lua @@ -3229,14 +3229,6 @@ query { } ]] -local function escape_char(string) - local escaped, _ = string.gsub(string, '["\\]', { - ['"'] = '\\"', - ["\\"] = "\\\\", - }) - return escaped -end - return function(query, ...) local opts = { escape = true } for _, v in ipairs { ... } do @@ -3245,13 +3237,9 @@ return function(query, ...) break end end - local escaped = {} + local args = {} for _, v in ipairs { ... } do - if type(v) == "string" and opts.escape then - table.insert(escaped, escape_char(v)) - else - table.insert(escaped, v) - end + table.insert(args, v) end - return string.format(M[query], unpack(escaped)) + return string.format(M[query], unpack(args)) end