Product
Socket Now Supports uv.lock Files
Socket now supports uv.lock files to ensure consistent, secure dependency resolution for Python projects and enhance supply chain security.
markdown-it-multimd-table
Advanced tools
Multimarkdown table syntax plugin for markdown-it markdown parser
MultiMarkdown table syntax plugin for markdown-it markdown parser
In general Markdown syntax, we have to write raw HTML tags when colspan
attribute is needed. Luckily, I found that MultiMarkdown had defined complete and clear rules for advanced Markdown table syntax, and compatible to general Markdown table syntax.
So I extend the table parser in markdown-it to support MultiMarkdown table syntax. For now, the following features are provided:
Noted that the plugin might behave differently from MultiMarkdown in some edge cases; since the plugin aims just to follow the rules in MultiMarkdown User's Guide.
var md = require('markdown-it')()
.use(require('markdown-it-multimd-table'));
md.render(/*...*/)
To simply test this plugin, you can do these in terminal:
$ mkdir markdown-it-multimd-table
$ cd markdown-it-multimd-table
$ npm install markdown-it-multimd-table --prefix .
$ vim test.js
var md = require('markdown-it')()
.use(require('markdown-it-multimd-table'));
const exampleTable =
"| | Grouping || \n" +
"First Header | Second Header | Third Header | \n" +
" ------------ | :-----------: | -----------: | \n" +
"Content | *Long Cell* || \n" +
"Content | **Cell** | Cell | \n" +
" \n" +
"New section | More | Data | \n" +
"And more | With an escaped '\\|' || \n" +
"[Prototype table] \n";
console.log(md.render(exampleTable));
$ node test.js > test.html
$ firefox test.html
And you will see the rendered table in the browser:
Grouping | ||
---|---|---|
First Header | Second Header | Third Header |
Content | Long Cell | |
Content | Cell | Cell |
New section | More | Data |
And more | With an escaped '|' |
Put backslashes at end to make the table rows parsed as multiple lines. This feature is contributed by Lucas-C.
First header | Second header
-------------|---------------
List: | More \
- over | data \
- several | \
- lines |
would be parsed as
First header | Second header |
---|---|
List:
|
More data |
And here's how you enable the feature.
var md = require('markdown-it')()
.use(require('markdown-it-multimd-table'), {enableMultilineRows: true});
To create cells with a rowspan mark the cells to merge up with ^^
.
This feature is contributed by pmccloghrylaing.
First header | Second header
-------------|---------------
Merged | Cell 1
^^ | Cell 2
^^ | Cell 3
would be parsed as
First header | Second header |
---|---|
Merged | Cell 1 |
Cell 2 | |
Cell 3 |
And here's how you enable the feature.
var md = require('markdown-it')()
.use(require('markdown-it-multimd-table'), {enableRowspan: true});
This software is licensed under the MIT license © RedBug312.
FAQs
Multimarkdown table syntax plugin for markdown-it markdown parser
We found that markdown-it-multimd-table demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Product
Socket now supports uv.lock files to ensure consistent, secure dependency resolution for Python projects and enhance supply chain security.
Research
Security News
Socket researchers have discovered multiple malicious npm packages targeting Solana private keys, abusing Gmail to exfiltrate the data and drain Solana wallets.
Security News
PEP 770 proposes adding SBOM support to Python packages to improve transparency and catch hidden non-Python dependencies that security tools often miss.