From 00a9281f395506ac355491d60767760f05b97a26 Mon Sep 17 00:00:00 2001 From: Dirk Kelly Date: Tue, 11 Jun 2019 17:01:48 +0800 Subject: [PATCH] Disable Highlight on mermaid objects --- static/js/learn.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/static/js/learn.js b/static/js/learn.js index 036952c4ba4..60852bd4ebb 100644 --- a/static/js/learn.js +++ b/static/js/learn.js @@ -229,7 +229,7 @@ jQuery(document).ready(function() { e.stopPropagation(); } }); - + jQuery(document).keydown(function(e) { // prev links - left arrow key if(e.which == '37') { @@ -264,7 +264,7 @@ jQuery(document).ready(function() { }); } - /** + /** * Fix anchor scrolling that hides behind top nav bar * Courtesy of https://stackoverflow.com/a/13067009/28106 * @@ -346,7 +346,7 @@ jQuery(document).ready(function() { $(document).ready($.proxy(anchorScrolls, 'init')); })(window.document, window.history, window.location); - + }); jQuery(window).on('load', function() { @@ -388,7 +388,7 @@ jQuery.extend({ highlight: function(node, re, nodeName, className) { if (node.nodeType === 3) { var match = node.data.match(re); - if (match) { + if (match && !$(node.parentNode).hasClass("mermaid")) { var highlight = document.createElement(nodeName || 'span'); highlight.className = className || 'highlight'; var wordNode = node.splitText(match.index);