jstransformer-lowlight
Lowlight support for JSTransformers.
import jstransformer from 'jstransformer'
import lowlight from 'jstransformer-lowlight'
const highlight = jstransformer(lowlight)
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>;'
Options
lang
(false
): the language of the code if you know it.prefix
(hljs-
): the class prefix.