JSPM

  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 16763
  • Score
    100M100P100Q145919F
  • License MIT

Multimarkdown table syntax plugin for markdown-it markdown parser

Package Exports

  • markdown-it-multimd-table

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (markdown-it-multimd-table) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

NPM version Build Status Coverage Status

Multimarkdown table syntax plugin for markdown-it markdown parser

Intro

Bored with HTML table tags when I need some extended table functions like colspan in Markdown. I found that MultiMarkdown had defined complete and clear rules for advanced table syntax, which is compatible to standard Markdown table syntax at the same time.

For example, the following features are given:

  • colspan attribute
  • Multiple <thead> and <tbody>
  • Captions

So I altered the table parser in markdown-it for the Multimarkdown syntax.

NOTE: This plugin might behave differently from MultiMarkdown for some edging cases; For this plugin was developed mainly under the rules in MultiMarkdown User's Guide. Please impose an issue if you find problems related.

Usage

var md = require('markdown-it')()
            .use(require('markdown-it-multimd-table'));

md.render(/*...*/)

For test, do this in terminal:

$ 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

Credits

  • MultiMarkdown, Lightweight markup processor to produce HTML, LaTeX, and more.
  • markdown-it, Markdown parser, done right. 100% CommonMark support, extensions, syntax plugins & high speed

License

This software is licensed under the MIT license © RedBug312.