]>
BookStack Code Mirror - bookstack/blob - resources/js/components/code-highlighter.js
projects
/
bookstack
/ blob
commit
grep
author
committer
pickaxe
?
search:
re
5ffab377525d875f34e02f7be6d65e68dee1c4c3
[bookstack]
/
resources
/
js
/
components
/
code-highlighter.js
1
class CodeHighlighter {
2
3
constructor(elem) {
4
const codeBlocks = elem.querySelectorAll('pre');
5
if (codeBlocks.length > 0) {
6
window.importVersioned('code').then(Code => {
7
Code.highlightWithin(elem);
8
});
9
}
10
}
11
12
}
13
14
export default CodeHighlighter;