Socket
Book a DemoInstallSign in
Socket

jstransformer-highlight

Package Overview
Dependencies
Maintainers
6
Versions
3
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

jstransformer-highlight

Highlight.js support for JSTransformers.

latest
Source
npmnpm
Version
2.0.0
Version published
Maintainers
6
Created
Source

jstransformer-highlight

Highlight.js support for JSTransformers.

Build Status Coverage Status Dependency Status Greenkeeper badge NPM version

Options

  • lang - The language the code is in
  • auto - defaults to true if lang is undefined. Set this to true to have highlight.js auto-detect the language. Set this to false to disable auto-detection even when there is no lang option.

Example

var highlight = require('jstransformer')(require('jstransformer-highlight'))

highlight.render('var i = 5 + 10;', { lang: 'javascript' }).body
//=> '<span class=\"hljs-variable\"><span class=\"hljs-keyword\">var</span> i</span> = <span class=\"hljs-number\">5</span> + <span class=\"hljs-number\">10</span>;'

License

MIT

Keywords

jstransformer

FAQs

Package last updated on 01 Jun 2018

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts