BookStack/resources/js/components/code-highlighter.js
Dan Brown a2bcf765a8
Split out codemirror JS to its own module
Added a cache-compatible module loading system/pattern to the codebase.
2022-02-08 11:10:01 +00:00

14 lines
No EOL
311 B
JavaScript

class CodeHighlighter {
constructor(elem) {
const codeBlocks = elem.querySelectorAll('pre');
if (codeBlocks.length > 0) {
window.importVersioned('code').then(Code => {
Code.highlightWithin(elem);
});
}
}
}
export default CodeHighlighter;