mirror of
https://github.com/BookStackApp/BookStack.git
synced 2024-10-01 01:36:00 -04:00
a2bcf765a8
Added a cache-compatible module loading system/pattern to the codebase.
14 lines
311 B
JavaScript
14 lines
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; |