Skip to content

Free, simple, and intuitive online database diagram editor and SQL generator.

fix: add missing pipe delimiters in Markdown table rows (#1002)

Sylvain8c2e412bab32
diff --git a/src/utils/exportAs/documentation.js b/src/utils/exportAs/documentation.js
index fd0347b2..c20e938e 100644
--- a/src/utils/exportAs/documentation.js
+++ b/src/utils/exportAs/documentation.js
@@ -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) {