package
PostHTML plugin render markdown inside html elements.
npm install posthtml-md2htmlGitHub-flavored package documentation.
Across all versions.
Download trend unavailable.
Runtime metadata.
Tagged topics.
Estimated unpacked size across 8 packages.
908.9 kB
Includes dependencies.
3 direct · 3 outdated
[posthtml-md2html] is a markdown plugin for [PostHTML] that lets you use markdown within HTML elements in an easy and intuitive way.
Main features:
md or markdown property<md> or <markdown>pre tag with md or markdown property as <md> tagBefore:
<markdown># Heading with *italics*</markdown>
<markdown>**Bold** paragraph</markdown>
<div markdown>
| Head | row |
|------|-----|
| Data | row |
</div>
<main markdown>
> # Title
>
> This is blockquote paragraph
</main>After:
<h1 id="heading-with-italics">Heading with <em>italics</em></h1>
<p><strong>Bold</strong> paragraph</p>
<div><table>
<thead>
<tr>
<th>Head</th>
<th>row</th>
</tr>
</thead>
<
npm i -S posthtml posthtml-md2htmlNote: This project is compatible with node v10+
const fs = require('fs');
const posthtml = require('posthtml');
const posthtmlPlugin = require('posthtml-md2html');
posthtml()
.use(posthtmlPlugin({ /* options */ }))
.process(html/*, options */)
.then(result => fs.writeFileSync('./after.html', result.html));All options are passed to marked directly
See PostHTML Guidelines and contribution guide.