A markdown-it plugin to merge adjacent cells with same content in tables
npm install markdown-it-merge-cellsIt will first merge cells with same content in every column and then merge cells with same content (and height, if ones are merged in first step) in every row. This is by design because usually a column is a field and a row is a record -- it's more reasonable that multi records have same value in a field than in a record multi fields' have same value.
js
// Node.js
let MarkdownIt = require('markdown-it'),
MarkdownItMergeCells = require('markdown-it-merge-cells'),
md = new MarkdownIt();
md.use(MarkdownItMergeCells);// Browser (use dist/bundle.min.js)
let md = new window.markdownit();
md.use(window.markdownitMergeCells);
let result = md.render(
)
`The result is:
1
3
4
5
1
1
2
6
7
4
3
5
The rendered HTML is:
`html
1
3
4
5
1
1
2
6
7
4
3
5
``File a issue if you find this plugin can't work with latest version of markdown-it.