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

Commit 3e12239

Browse files
Merge pull request #43 from emmanueltouzery/table_newlines
remove newlines in table cells
2 parents 0e08b85 + aeb3b73 commit 3e12239

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
@@ -342,7 +342,7 @@ function transpiler:eval_table(node)
342342

343343
if not col_len then break end
344344

345-
result = result .. "| " .. value .. string.rep(" ", col_len - #value + 1)
345+
result = result .. "| " .. string.gsub(value, "\n", "") .. string.gsub(string.rep(" ", col_len - #value + 1), "\n", "")
346346
current_col = current_col + 1
347347

348348
if colspan > 1 then
@@ -377,7 +377,7 @@ function transpiler:eval_table(node)
377377
current_col = current_col + 1
378378
end
379379
end
380-
result = result .. "| " .. line .. " "
380+
result = result .. "| " .. string.gsub(line, "\n", "") .. " "
381381
end
382382

383383
result = result .. "|\n"

0 commit comments

Comments
 (0)