mirror of
https://github.com/drawdb-io/drawdb.git
synced 2026-05-07 02:00:40 +08:00
fix: add missing pipe delimiters in Markdown table rows (#1002)
This commit is contained in:
@@ -12,10 +12,10 @@ function formatMarkdownTable(headers, rows) {
|
||||
const separator = colWidths.map((w) => "-".repeat(w)).join(" | ");
|
||||
const headerRow = headers.map((h, i) => pad(h, colWidths[i])).join(" | ");
|
||||
const dataRows = rows
|
||||
.map((row) => row.map((cell, i) => pad(cell, colWidths[i])).join(" | "))
|
||||
.map((row) => `| ${row.map((cell, i) => pad(cell, colWidths[i])).join(" | ")} |`)
|
||||
.join("\n");
|
||||
|
||||
return `| ${headerRow} |\n| ${separator} |\n| ${dataRows} |`;
|
||||
return `| ${headerRow} |\n| ${separator} |\n${dataRows}`;
|
||||
}
|
||||
|
||||
export function jsonToDocumentation(obj) {
|
||||
|
||||
Reference in New Issue
Block a user