Package bundling a few markdown-it plugins to approximate pandoc flavoured markdown.
For a demo, you can try PanWriter.
This package requires a lot of peer dependencies, depending on which extensions you enable. For up-to-date information, it is probably best to take a quick look at the source.
Options | Plugin dependency |
---|---|
bracketed_spans + attributes |
markdown-it-bracketed-spans |
attributes |
markdown-it-attrs |
fenced_divs + attributes |
markdown-it-container |
definition lists |
markdown-it-deflist |
footnotes |
markdown-it-footnote |
implicit_figures |
markdown-it-implicit-figures |
grid_tables |
markdown-it-gridtables |
subscript |
markdown-it-sub |
superscript |
markdown-it-sup |
task_lists |
markdown-it-task-lists |
katex |
markdown-it-texmath, katex |
mathjax |
markdown-it-mathjax3 |
var md = require('markdown-it')();
require('markdown-it-pandoc')(md);
md.render('my markdown string');
There is an optional second argument to enable/disable markdown-it-pandoc
extensions. For example:
var md = require('markdown-it')({ html: true });
require('markdown-it-pandoc')(md, { implicit_figures: false });
md.render('my markdown string');
Or using import syntax:
import markdownIt from 'markdown-it'
import markdownItPandoc from 'markdown-it-pandoc'
const md = markdownItPandoc(
markdownIt({ html: true }),
{ implicit_figures: false }
);
md.render('my markdown string');
Note that MathJax and KaTeX are exclusive features. You cannot set both options true.