BookStack/resources/js/components/code-highlighter.js
2022-11-15 11:24:31 +00:00

16 lines
379 B
JavaScript

import {Component} from "./component";
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(container);
});
}
}
}