mirror of
https://github.com/BookStackApp/BookStack.git
synced 2024-08-26 12:16:07 +00:00
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; |