Need help with md?
Click the “chat” button below for chat support from the developer who created it, or find similar developers for support.

About the developer

egoist
128 Stars 14 Forks MIT License 46 Commits 4 Opened issues

Description

A markdown parser and compiler. Built for speed.

Services available

!
?

Need anything else?

Contributors list

No Data

md

NPM version NPM downloads Build Status codecov donate

This is a fork of marked

Why?

  • Actively maintained
  • Rewrote in ES6 and bundled with Rollup for smaller size (15KB)
  • Support more GFM extras like task lists

Install

yarn add md

You can find a CDN version at https://unpkg.com/md/

Usage

const md = require('md')

const html = md(`## hello world

A modern markdown parser!

  • todo
  • done `)

You can preview the HTML result here: https://egoist.moe/md2html/ (source)

API

md(src, [options])

src

Type:

string

Required:
true

Input markdown string.

options

All marked options plus:

taskLists

Type:

boolean

Default:
true

Enable GFM task lists, this will only work if

options.gfm
is
true
.
linksInNewTab

Type:

boolean | (href: string) => boolean

Default:
undefined

Open links in a new window/tab.

dataLine

Type:

boolean

Default:
true

Add

data-line
attribute to
 tag for code fences, it's useful with the line-highlight plugin in PrismJS. 
```js{1}
console.log('hi')
This will yield:

```html

console.log('hi')

Contributing

  1. Fork it!
  2. Create your feature branch:
    git checkout -b my-new-feature
  3. Commit your changes:
    git commit -am 'Add some feature'
  4. Push to the branch:
    git push origin my-new-feature
  5. Submit a pull request :D

Development

# lint and unit test
yarn test

lint only

yarn lint

fix lint issues

yarn lint -- --fix

Author

md © egoist, Released under the MIT License.
Authored and maintained by egoist with help from contributors (list).

egoist.moe · GitHub @egoist · Twitter @_egoistlily

We use cookies. If you continue to browse the site, you agree to the use of cookies. For more information on our use of cookies please see our Privacy Policy.