From 81cb10545be5a659f043e0a7fbee57fd9d9394f0 Mon Sep 17 00:00:00 2001 From: Myzel394 <50424412+Myzel394@users.noreply.github.com> Date: Sun, 8 Oct 2023 14:05:37 +0200 Subject: [PATCH] fix: Removing padding when importing from table --- lua/easytables/import.lua | 2 +- lua/easytables/init.lua | 3 --- 2 files changed, 1 insertion(+), 4 deletions(-) diff --git a/lua/easytables/import.lua b/lua/easytables/import.lua index aaeae2e..ac449c2 100644 --- a/lua/easytables/import.lua +++ b/lua/easytables/import.lua @@ -87,7 +87,7 @@ local function extract_table( table[#table + 1] = {} for content in string.gmatch(line, "[^" .. o.options.export.markdown.characters.vertical .. "]+") do - table[#table][#table[#table] + 1] = content + table[#table][#table[#table] + 1] = string.gsub(content, '^%s*(.-)%s*$', '%1') end end end diff --git a/lua/easytables/init.lua b/lua/easytables/init.lua index 3ec6e28..08d5b05 100644 --- a/lua/easytables/init.lua +++ b/lua/easytables/init.lua @@ -58,10 +58,7 @@ local function setup(options) return end - print(vim.inspect(start_row), vim.inspect(end_row)) - local raw_table = import.extract_table(buffer, start_row, end_row) - print(vim.inspect(raw_table)) local markdown_table = table:import(raw_table)