summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMunken <mm.munk@gmail.com>2016-12-08 23:21:27 +0000
committerMunken <mm.munk@gmail.com>2016-12-08 23:21:27 +0000
commit7f829f52e1faff770eca93b9ffdcd1c4832f62fd (patch)
treeed02b20752f992a46618cf1971ee6149c1b43129
parenta36ee0ad4400b7e38bfa33ae99838dcb9527e870 (diff)
downloadgitlab-ce-7f829f52e1faff770eca93b9ffdcd1c4832f62fd.tar.gz
Don't double render
-rw-r--r--app/assets/javascripts/syntax_highlight.js.erb3
1 files changed, 3 insertions, 0 deletions
diff --git a/app/assets/javascripts/syntax_highlight.js.erb b/app/assets/javascripts/syntax_highlight.js.erb
index 3b9a7d9baf9..ea79e82d887 100644
--- a/app/assets/javascripts/syntax_highlight.js.erb
+++ b/app/assets/javascripts/syntax_highlight.js.erb
@@ -19,6 +19,9 @@
// Loop over all math elements and render math
var renderWithKaTeX = function (elements) {
elements.each(function () {
+ if (!!$(this).attr('rendered')) return;
+
+ $(this).attr('rendered', true);
$(this).hide();
var mathNode = $( "<math>Test</math>" );
mathNode.insertAfter($(this));