JSPM

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

A PostHTML plugin to transform markdown using markdown-it

Package Exports

  • posthtml-markdownit

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 (posthtml-markdownit) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

PostHTML Plugin Boilerplate

NPM Build Coverage Standard Code Style

This plugin is for converting markdown to html using markdown-it. (PS. This is my first plugin so go easy on me.)

Before: ``` html # Markdown, Yeah!

Working !


After:
``` html
<div class="lol">
    <h1>Markdown, Yeah!</h1>
    <hr>
    <blockquote>
    <p>Working !</p>
    </blockquote>

</div>

Install

npm i posthtml posthtml-markdownit -D

Usage

Options will be directly passed into markdown-it. This plugin calculates whitespaces based on the first indented text.

const fs = require('fs');
const posthtml = require('posthtml');
const markdown = require('posthtml-markdownit');

posthtml()
    .use(markdown({ /* options */ }))
    .process(html/*, options */)
    .then(result => fs.writeFileSync('./after.html', result.html));

Options

All options are passed to markdown-it

Contributing

See PostHTML Guidelines and contribution guide.

License MIT