Reshape Markdown
Reshape Markdown lets you use Markdown in HTML.
<!-- before -->
<h1 md>Reshape **Markdown**</h1>
<div md>It knows *when* to work.</div>
<p md>It knows *how* to work.</p>
<md>It just [works](https://github.com/jonathantneal/reshape-md).</md>
<!-- after -->
<h1>Reshape <strong>Markdown</strong></h1>
<div><p>It knows <em>when</em> to work.</p></div>
<p>It knows <em>how</em> to work.</p>
<p>It just <a href="https://github.com/jonathantneal/reshape-md">works</a>.</p>
Usage
Add Reshape and Reshape Markdown to your build tool:
npm install reshape reshape-md --save-dev
Use Reshape Markdown as a plugin:
require('reshape')({
plugins: [
require('reshape-md')(/* Options */)
]
}).process(YOUR_HTML);
Options
elements
Type: Array
Default: [ "markdown", "md" ]
The list of elements which will be replaced with rendered Markdown.
attrs
Type: Array
Default: [ "markdown", "md" ]
The list of attributes on elements which will be replaced with rendered Markdown.
md
Type: Object
Default: {}
The hash of options applied to marked, the tool used to parse Markdown.