3 var markdownTable = require('markdown-table');
5 module.exports = table;
9 * Creates a fenced table by default, but not in
10 * `looseTable: true` mode:
16 * NOTE: Be careful with `looseTable: true` mode, as a
17 * loose table inside an indented code block on GitHub
18 * renders as an actual table!
20 * Creates a spaced table by default, but not in
21 * `spacedTable: false`:
27 function table(node) {
29 var options = self.options;
30 var loose = options.looseTable;
31 var spaced = options.spacedTable;
32 var pad = options.paddedTable;
33 var stringLength = options.stringLength;
34 var rows = node.children;
35 var index = rows.length;
36 var exit = self.enterTable();
42 result[index] = self.all(rows[index]);
58 return markdownTable(result, {
63 stringLength: stringLength,
64 delimiter: spaced ? ' | ' : '|'