xmitter-11ty/_src/eleventy-liquidjs-tag-highlight-prismjs.js

12 lines
345 B
JavaScript
Raw Normal View History

2018-01-28 00:50:07 -05:00
const Prism = require('prismjs');
const LiquidHighlight = require( "./LiquidHighlight" );
module.exports = function(liquidEngine) {
let highlight = new LiquidHighlight(liquidEngine);
highlight.addHook(function(language, htmlStr, lines) {
return Prism.highlight(htmlStr, Prism.languages[ language ]);
});
return highlight.getObject();
};