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

14 lines
311 B
JavaScript
Raw Normal View History

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