diff --git a/lua/markview/parser.lua b/lua/markview/parser.lua index 1f88b49..ab8a7d8 100644 --- a/lua/markview/parser.lua +++ b/lua/markview/parser.lua @@ -386,15 +386,20 @@ parser.md = function (buffer, TStree, from, to) table.insert(table_structure, "unknown"); end - for col in vim.treesitter.get_node_text(row, buffer):gmatch("%s*|([^|\n]*)") do - if col ~= "" then + local t_col = nil; + + for col in vim.treesitter.get_node_text(row, buffer):gmatch("|([^|\n]*)") do + if col:match("\\$") then + t_col = col .. "|"; + elseif col ~= "" then table.insert(tmp, "|") - table.insert(tmp, col) + table.insert(tmp, (t_col or "") .. col) + + t_col = nil; end end table.insert(tmp, "|") - table.insert(rows, tmp) end diff --git a/lua/markview/renderer.lua b/lua/markview/renderer.lua index 95ef7a1..5f51f20 100644 --- a/lua/markview/renderer.lua +++ b/lua/markview/renderer.lua @@ -471,7 +471,7 @@ local table_header = function (buffer, content, config_table) vim.api.nvim_buf_set_extmark(buffer, renderer.namespace, row_start, col_start + curr_col + #col, { virt_text_pos = "inline", virt_text = { - { string.rep("X", (actual_width - width)) } + { string.rep(" ", (actual_width - width)) } } }); elseif align == "right" then