From 3d6778e1fe191c2af21e4d1e9f87a8e9166f13f4 Mon Sep 17 00:00:00 2001 From: Le Tan Date: Thu, 10 Nov 2016 22:39:57 +0800 Subject: [PATCH] fix highlightjs bug with code block We should distinguish and
.

Signed-off-by: Le Tan 
---
 src/resources/pre_template.html | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/src/resources/pre_template.html b/src/resources/pre_template.html
index f2142cc7..b7c37693 100644
--- a/src/resources/pre_template.html
+++ b/src/resources/pre_template.html
@@ -26,7 +26,9 @@
 
       var codes = document.getElementsByTagName('code');
       for (var i = 0; i < codes.length; ++i) {
-          hljs.highlightBlock(codes[i]);
+          if (codes[i].parentElement.tagName.toLowerCase() == 'pre') {
+              hljs.highlightBlock(codes[i]);
+          }
       }
   }