1
0
mirror of https://github.com/BookStackApp/BookStack.git synced 2025-07-27 06:01:54 +03:00

Updated a batch of JS components

This commit is contained in:
Dan Brown
2022-11-15 11:24:31 +00:00
parent 09c6a3c240
commit 4310d34135
19 changed files with 124 additions and 128 deletions

View File

@ -1,14 +1,16 @@
class CodeHighlighter {
import {Component} from "./component";
constructor(elem) {
const codeBlocks = elem.querySelectorAll('pre');
export class CodeHighlighter extends Component{
setup() {
const container = this.$el;
const codeBlocks = container.querySelectorAll('pre');
if (codeBlocks.length > 0) {
window.importVersioned('code').then(Code => {
Code.highlightWithin(elem);
Code.highlightWithin(container);
});
}
}
}
export default CodeHighlighter;
}