xmitter-11ty/_src/eleventy-liquidjs-tag-highlight-prismjs.js
2018-01-27 23:50:07 -06:00

12 lines
345 B
JavaScript

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();
};