Plugin to create conditional block-level containers for markdown-it markdown parser
npm install markdown-it-condition> Plugin for creating if-else conditional blocks for markdown-it markdown parser.
With this plugin you can create conditional block like:
```
::if condition
Show if condition is true
::else
Show if condition is false
::endif
... and the selected content will be rendered as markdown markup.
` This text will be shownhtml`
Derived from markdown-it-container.
node.js, browser:
`bash`
$ npm install markdown-it-condition --save
$ bower install markdown-it-condition --save
`js`
var md = require('markdown-it')()
.use(require('markdown-it-condition'), name [, options]);
`js
var md = require('markdown-it')();
md.use(require('markdown-it-condition'));
console.log(md.render('::if flag.value\nThis text will be shown\n::else\n*This text won\'t\n::endif'), {
flag: {
value: true
}
});
// Output:
//
//
This text will be shown