Nectar of the Programming Masses
Miss any of our Open RFC calls?Watch the recordings here! »

@menubar/markup-it

5.1.5 • Public • Published

markup-it

Build Status NPM version

markup-it is a JavaScript library to serialize/deserialize markdown content using an intermediate format backed by an immutable model.

Installation

$ npm i markup-it --save

Usage

Parse markdown

const { State } = require('markup-it');
const markdown = require('markup-it/lib/markdown');
 
const state = State.create(markdown);
const document = state.deserializeToDocument('Hello **World**');

Render document to HTML

const { State } = require('markup-it');
const html = require('markup-it/lib/html');
 
const state = State.create(html);
const str = state.serializeDocument(document);

Render document to Markdown

const { State } = require('markup-it');
const markdown = require('markup-it/lib/markdown');
 
const state = State.create(markdown);
const str = state.serializeDocument(document);

Install

npm i @menubar/markup-it

DownloadsWeekly Downloads

1

Version

5.1.5

License

Apache-2.0

Last publish

Collaborators

  • avatar