diff --git a/plugins/file-highlight/prism-file-highlight.js b/plugins/file-highlight/prism-file-highlight.js index 6a2a540635..ba01920f4f 100644 --- a/plugins/file-highlight/prism-file-highlight.js +++ b/plugins/file-highlight/prism-file-highlight.js @@ -71,6 +71,10 @@ }; - self.Prism.fileHighlight(); + if (document.addEventListener) { + document.addEventListener('DOMContentLoaded', self.Prism.fileHighlight); + } else { + self.Prism.fileHighlight(); + } })();