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

16 lines
378 B
JavaScript

const LiquidHighlight = require( "./LiquidHighlight" );
module.exports = function(liquidEngine) {
let highlight = new LiquidHighlight(liquidEngine);
highlight.addClassHook(function(language, line) {
if( language === "dir" ) {
// has trailing slash
if( line.match(/\/$/) !== null ) {
return "highlight-line-isdir";
}
}
});
return highlight.getObject();
};