2020-01-18 14:03:11 +00:00
|
|
|
class CodeHighlighter {
|
|
|
|
|
|
|
|
constructor(elem) {
|
2022-02-08 11:10:01 +00:00
|
|
|
const codeBlocks = elem.querySelectorAll('pre');
|
|
|
|
if (codeBlocks.length > 0) {
|
|
|
|
window.importVersioned('code').then(Code => {
|
|
|
|
Code.highlightWithin(elem);
|
|
|
|
});
|
|
|
|
}
|
2020-01-18 14:03:11 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
export default CodeHighlighter;
|