From 841f9d0f9bb766b8dc67c7f2fa3c25a2555a8f19 Mon Sep 17 00:00:00 2001 From: Hakim El Hattab Date: Tue, 22 Jul 2014 10:30:26 +0200 Subject: [PATCH] only load highlight.js if there's a 'pre code' block on page --- index.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/index.html b/index.html index 6285c549..2d3ede16 100644 --- a/index.html +++ b/index.html @@ -408,7 +408,7 @@ function linkify( selector ) { { src: 'lib/js/classList.js', condition: function() { return !document.body.classList; } }, { src: 'plugin/markdown/marked.js', condition: function() { return !!document.querySelector( '[data-markdown]' ); } }, { src: 'plugin/markdown/markdown.js', condition: function() { return !!document.querySelector( '[data-markdown]' ); } }, - { src: 'plugin/highlight/highlight.js', async: true, callback: function() { hljs.initHighlightingOnLoad(); } }, + { src: 'plugin/highlight/highlight.js', async: true, condition: function() { return !!document.querySelector( 'pre code' ); }, callback: function() { hljs.initHighlightingOnLoad(); } }, { src: 'plugin/zoom-js/zoom.js', async: true, condition: function() { return !!document.body.classList; } }, { src: 'plugin/notes/notes.js', async: true, condition: function() { return !!document.body.classList; } } ]