X-Git-Url: http://source.bookstackapp.com/bookstack/blobdiff_plain/82a8db373961d89ab1c9a3736ba5fc467fe2e03d..refs/pull/3698/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; } }