]> BookStack Code Mirror - bookstack/blobdiff - resources/js/components/details-highlighter.js
Added more complexity in an attempt to make ldap host failover fit
[bookstack] / resources / js / components / details-highlighter.js
index 18c5165faf49408e140685d5cc0e0ddceeaead2c..1f3b66c674c2c882b7f1d71b4fcb79867c06dcfe 100644 (file)
@@ -1,4 +1,3 @@
-import Code from "../services/code"
 class DetailsHighlighter {
 
     constructor(elem) {
@@ -10,7 +9,11 @@ class DetailsHighlighter {
     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;
     }
 }