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

16 lines
378 B
JavaScript
Raw Normal View History

2018-01-28 00:50:07 -05:00
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();
};