mirror of
https://github.com/BookStackApp/BookStack.git
synced 2024-11-26 02:10:19 +08: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; |