From 3c37584b40c837b03892b397672787dfd697c62b Mon Sep 17 00:00:00 2001 From: benweet Date: Sun, 16 Feb 2014 15:34:11 +0000 Subject: [PATCH] Fixed highlight.js problem with partial rendering --- public/res/extensions/markdownExtra.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/public/res/extensions/markdownExtra.js b/public/res/extensions/markdownExtra.js index e03e1be3..9e95acdf 100644 --- a/public/res/extensions/markdownExtra.js +++ b/public/res/extensions/markdownExtra.js @@ -95,7 +95,8 @@ define([ var previewContentsElt = document.getElementById('preview-contents'); editor.hooks.chain("onPreviewRefresh", function() { _.each(previewContentsElt.querySelectorAll('.prettyprint > code'), function(elt) { - hljs.highlightBlock(elt); + !elt.highlighted && hljs.highlightBlock(elt); + elt.highlighted = true; }); }); }