BookStack/resources/js/components/code-highlighter.js

14 lines
311 B
JavaScript
Raw Normal View History

2020-01-18 09:03:11 -05:00
class CodeHighlighter {
constructor(elem) {
const codeBlocks = elem.querySelectorAll('pre');
if (codeBlocks.length > 0) {
window.importVersioned('code').then(Code => {
Code.highlightWithin(elem);
});
}
2020-01-18 09:03:11 -05:00
}
}
export default CodeHighlighter;