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

14 lines
311 B
JavaScript
Raw Normal View History

2020-01-18 15:03:11 +01: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 15:03:11 +01:00
}
}
export default CodeHighlighter;