npm.io
1.0.1 • Published 11 years ago

markdown-it-highlighted

Licence
Unlicense
Version
1.0.1
Deps
0
Vulns
0
Weekly
0
Stars
4

markdown-it-highlighted npm version

Whether code was highlighted during markdown-it rendering.

Usage

const md = require('markdown-it')({ highlight: yourHighlighter })
  .use(require('markdown-it-highlighted'))

const env = {}

md.render('```js\nconsole.log(42)\n```', env)
env.highlighted === true // Assuming your highlighter handled the code.

md.render('# Hello, world!', env)
env.highlighted === false

Keywords