Javascript Markdown parser: Markdown-it

Javascript Markdown parser: Markdown-it

Apr 25, 2019 / Ramesh Mhetre

Markdown is a light weight markup language with plain text formatting syntax. Its design allows to be converted to many output formats. Markdown is often used to format readme files, for writing messages in online discussion forums, and to create rich text using a plain text editor.

Markdown-it is a javascript library/package which converts markdown text to HTML. Its very fast, efficient & easy to use within your project.

Markdown-it live demo

Install Markdown-it

You can use either npm or bower or CDN:

npm install markdown-it --save
bower install markdown-it --save

How to use markdown parser

// node.js, "classic" way:
var MarkdownIt = require('markdown-it'),
    md = new MarkdownIt();
var result = md.render('# markdown-it rulezz!');

// node.js, the same, but with sugar:
var md = require('markdown-it')();
var result = md.render('# markdown-it rulezz!');

// browser without AMD, added to "window" on script load
// Note, there is no dash in "markdownit".
var md = window.markdownit();
var result = md.render('# markdown-it rulezz!');

Here is the complete API documentation & many examples.

What is awesome about markdown-it

  • Follows the CommonMark Spec + adds syntax extensions & sugar (URL autolinking, typographer)
  • Configurable syntax! One can add new rules & replace existing one if required.
  • High Speed.
  • Safety is being taken care of.
  • Many community-written plugins & packages on npm.
Vue.js Angular Packages Angular News Vue.js News Angular Vue.js Packages

Similar Articles

VuePress: Powerfull, static website generator with VueJs

VuePress: Powerfull, static website generator with VueJs

VuePress is a minimalistic Vue-powered static site generator from Evan You, the creator of Vue.js.
Read more...
A fancy VueJs time picker

A fancy VueJs time picker

Vuejs time picker with material design theme.
Read more...
Internet connection monitoring in Angular6

Internet connection monitoring in Angular6

Detect internet connection inside running angular application so you can change the behavior of the application.
Read more...