@11ty/eleventy-plugin-syntaxhighlight
Version:
Prism.js based syntax highlighting for Markdown, Liquid, Nunjucks, WebC, and 11ty.js templates.
14 lines (11 loc) • 331 B
JavaScript
module.exports = function(templateFormats = ["*"], format = false) {
if(!Array.isArray(templateFormats)) {
templateFormats = [templateFormats];
}
if( Array.isArray(templateFormats) ) {
if( templateFormats.indexOf("*") > -1 || templateFormats.indexOf(format) > -1 ) {
return true;
}
}
return false;
};