Security News
Research
Data Theft Repackaged: A Case Study in Malicious Wrapper Packages on npm
The Socket Research Team breaks down a malicious wrapper package that uses obfuscation to harvest credentials and exfiltrate sensitive data.
markdown-it-multimd-table
Advanced tools
Multimarkdown table syntax plugin for markdown-it markdown parser
MultiMarkdown table syntax plugin for markdown-it markdown parser
Markdown specs defines only the basics for tables. When users want common
features like colspan
, they must fallback to raw HTML. And writing tables in
HTML is truly lengthy and troublesome.
This plugin extends markdown-it with MultiMarkdown table syntax. MultiMarkdown is an extended Markdown spec. It defines clear rules for advanced Markdown table syntax, while being consistent with original pipe table; markdown-it is a popular Markdown parser in JavaScript and allows plugins extending itself.
The features are provided:
Noted that the plugin is not a re-written of MultiMarkdown. This plugin will behave differently from the official compiler, but doing its best to obey rules defined in MultiMarkdown User's Guide. Please pose an issue if there are weird results for sensible inputs.
// defaults
var md = require('markdown-it')()
.use(require('markdown-it-multimd-table'));
// full options list (equivalent to defaults)
var md = require('markdown-it')()
.use(require('markdown-it-multimd-table'), {
multiline: false,
rowspan: false,
headerless: false,
multibody: true,
aotolabel: true,
});
md.render(/*...*/)
For a quick demo:
$ mkdir markdown-it-multimd-table
$ cd markdown-it-multimd-table
$ npm install markdown-it 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
Here's the table expected on browser:
Grouping | ||
---|---|---|
First Header | Second Header | Third Header |
Content | Long Cell | |
Content | Cell | Cell |
New section | More | Data |
And more | With an escaped '|' |
Noted that GitHub filters out style
property, so the example uses align
the
obsolete one. However it outputs style="text-align: ..."
in actual.
Backslash at end merges with line content below.
Feature contributed by Lucas-C.
| Markdown | Rendered HTML |
|--------------|---------------|
| *Italic* | *Italic* | \
| | |
| - Item 1 | - Item 1 | \
| - Item 2 | - Item 2 |
| ```python | ```python \
| .1 + .2 | .1 + .2 \
| ``` | ``` |
This is parsed below when the option enabled:
Markdown | Rendered HTML |
---|---|
|
Italic |
|
|
|
|
^^
indicates cells being merged above.
Feature contributed by pmccloghrylaing.
Stage | Direct Products | ATP Yields
----: | --------------: | ---------:
Glycolysis | 2 ATP ||
^^ | 2 NADH | 3--5 ATP |
Pyruvaye oxidation | 2 NADH | 5 ATP |
Citric acid cycle | 2 ATP ||
^^ | 6 NADH | 15 ATP |
^^ | 2 FADH2 | 3 ATP |
**30--32** ATP |||
[Net ATP yields per hexose]
This is parsed below when the option enabled:
Stage | Direct Products | ATP Yields |
---|---|---|
Glycolysis | 2 ATP | |
2 NADH | 3–5 ATP | |
Pyruvaye oxidation | 2 NADH | 5 ATP |
Citric acid cycle | 2 ATP | |
6 NADH | 15 ATP | |
2 FADH2 | 3 ATP | |
30–32 ATP |
Table header can be eliminated.
|--|--|--|--|--|--|--|--|
|♜| |♝|♛|♚|♝|♞|♜|
| |♟|♟|♟| |♟|♟|♟|
|♟| |♞| | | | | |
| |♗| | |♟| | | |
| | | | |♙| | | |
| | | | | |♘| | |
|♙|♙|♙|♙| |♙|♙|♙|
|♖|♘|♗|♕|♔| | |♖|
This is parsed below when the option enabled:
♜ | ♝ | ♛ | ♚ | ♝ | ♞ | ♜ | |
♟ | ♟ | ♟ | ♟ | ♟ | ♟ | ||
♟ | ♞ | ||||||
♗ | ♟ | ||||||
♙ | |||||||
♘ | |||||||
♙ | ♙ | ♙ | ♙ | ♙ | ♙ | ♙ | |
♖ | ♘ | ♗ | ♕ | ♔ | ♖ |
An empty line separates consecutive table bodies. When disabled, an empty line always cuts off the tables.
Table id
attribute follows the table caption if not labeled. When disabled,
caption without labels cannot generate the attribute.
This software is licensed under the MIT license © RedBug312.
FAQs
Multimarkdown table syntax plugin for markdown-it markdown parser
The npm package markdown-it-multimd-table receives a total of 7,005 weekly downloads. As such, markdown-it-multimd-table popularity was classified as popular.
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.
Security News
Research
The Socket Research Team breaks down a malicious wrapper package that uses obfuscation to harvest credentials and exfiltrate sensitive data.
Research
Security News
Attackers used a malicious npm package typosquatting a popular ESLint plugin to steal sensitive data, execute commands, and exploit developer systems.
Security News
The Ultralytics' PyPI Package was compromised four times in one weekend through GitHub Actions cache poisoning and failure to rotate previously compromised API tokens.