Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
14 commits
Select commit Hold shift + click to select a range
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 13 additions & 0 deletions lua/markview/parsers/markdown.lua
Original file line number Diff line number Diff line change
Expand Up @@ -885,8 +885,19 @@ markdown.table = function (_, _, text, range)
end

for l, line in ipairs(text) do
--- Strip block_continuation prefixes(e.g. `> `)
--- from lines after the first.
--- `get_node_text()` only applies col_start to line 1.
if l > 1 then
line = line:sub(range.col_start + 1);
end

local row_text = line;

if row_text == "" or row_text:match("^%s*$") then
goto continue;
end

if l == 1 then
header = line_processor(row_text);
elseif l == 2 then
Expand Down Expand Up @@ -917,6 +928,8 @@ markdown.table = function (_, _, text, range)
else
table.insert(rows, line_processor(row_text))
end

::continue::
end

local top_border, border_overlap = overlap(range.row_start);
Expand Down
Loading
Loading