X-Git-Url: http://source.bookstackapp.com/bookstack/blobdiff_plain/b94b945fb03e21a1997cfe6e50148967586cb26d..refs/pull/3593/head:/resources/js/components/details-highlighter.js diff --git a/resources/js/components/details-highlighter.js b/resources/js/components/details-highlighter.js index 18c5165fa..1f3b66c67 100644 --- a/resources/js/components/details-highlighter.js +++ b/resources/js/components/details-highlighter.js @@ -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; } }