Skip to content
This repository was archived by the owner on May 16, 2024. It is now read-only.

Commit aeb3b73

Browse files
remove newlines in table cells
prevents bad rendering such as | cell1 | cell2 | will now be: | cell1 | cell2 |
1 parent 57074bc commit aeb3b73

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

lua/nvim-devdocs/transpiler.lua

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -340,7 +340,7 @@ function transpiler:eval_table(node)
340340

341341
if not col_len then break end
342342

343-
result = result .. "| " .. value .. string.rep(" ", col_len - #value + 1)
343+
result = result .. "| " .. string.gsub(value, "\n", "") .. string.gsub(string.rep(" ", col_len - #value + 1), "\n", "")
344344
current_col = current_col + 1
345345

346346
if colspan > 1 then
@@ -375,7 +375,7 @@ function transpiler:eval_table(node)
375375
current_col = current_col + 1
376376
end
377377
end
378-
result = result .. "| " .. line .. " "
378+
result = result .. "| " .. string.gsub(line, "\n", "") .. " "
379379
end
380380

381381
result = result .. "|\n"

0 commit comments

Comments
 (0)