jstransformer-highlight
v2.0.0
Published
Highlight.js support for JSTransformers.
Downloads
815
Keywords
Readme
jstransformer-highlight
Highlight.js support for JSTransformers.
Options
lang
- The language the code is inauto
- defaults totrue
iflang
is undefined. Set this totrue
to have highlight.js auto-detect the language. Set this tofalse
to disable auto-detection even when there is nolang
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