markdown-it-table-merge-cells
v1.0.5
Published
Table syntax plugin for markdown-it markdown parser
Downloads
10
Maintainers
Readme
✨ markdown-it-table-merge-cells
🦜
markdown-it
增强辅助类表格语法插件(目前只支持列合并和行合并。后面会考虑加入行列合并。)🦞 由于
markdown-it-multimd-table
不支持配合prettier
格式化一起使用,可读性和可维护性就比较差,因此我自己写一个。🦈 凡是用
markdown-it
作为解析器的markdown
编辑器,只要该编辑器支持配置即可使用此插件扩展表格语法。🦜
markdown-it
enhanced auxiliary class table syntax plug-in (Currently, only column merging and row merging are supported. Will consider joining the column merge later.)🦞 Because
markdown-it-multimd-table
is not supported withprettier
formatting, making it less readable and maintainable, so I wrote my own.🦈 Any
markdown
editor that usesmarkdown-it
as the parser can use this plugin to extend the table syntax as long as the editor supports configuration.
🐸 Usage
npm i markdown-it -D
npm i markdown-it-table-merge-cells -D
// 以上两行效果同下行/The above two lines have the same downward effect
npm i markdown-it markdown-it-table-merge-cells -D
import MarkdownIt from "markdown-it";
import TableMergeCells from "markdown-it-table-merge-cells";
const md = new MarkdownIt()
md.use(TableMergeCells);
console.log(
md.render(`
| 4col | == | == | == |
| :-----: | :-----: | :--: | :-----: |
| 2row | content | 3row | content |
| ^^ | content | ^^ | content |
| content | content | ^^ | content |
`)
);
- 以下是浏览器上预期的表格:
- Here's the table expected on browser:
License
MIT © itianci