-import Code from "../services/code"
class DetailsHighlighter {
constructor(elem) {
onToggle() {
if (this.dealtWith) return;
- Code.highlightWithin(this.elem);
+ if (this.elem.querySelector('pre')) {
+ window.importVersioned('code').then(Code => {
+ Code.highlightWithin(this.elem);
+ });
+ }
this.dealtWith = true;
}
}