theme: ensure IE11 compatiblity

This commit is contained in:
Sören Weber 2021-09-13 21:09:44 +02:00
parent 82b7477c0c
commit b5e90f03dd
No known key found for this signature in database
GPG key ID: 07D17FF580AE7589
3 changed files with 5 additions and 5 deletions
static/js

View file

@ -104,7 +104,7 @@ function initMermaid() {
$(element).parent().replaceWith('<div class="mermaid" align="center">' + content + '</div>');
});
if (mermaid) {
if (typeof mermaid != 'undefined') {
mermaid.mermaidAPI.initialize( Object.assign( {}, mermaid.mermaidAPI.getSiteConfig(), { startOnLoad: true } ) );
mermaid.contentLoaded();
$(".mermaid svg").svgPanZoom({})
@ -538,7 +538,7 @@ jQuery(function() {
jQuery.extend({
highlight: function(node, re, nodeName, className) {
if (node.nodeType === 3 && node.parentElement.namespaceURI == 'http://www.w3.org/1999/xhtml') { // text nodes
if (node.nodeType === 3 && node.parentElement && node.parentElement.namespaceURI == 'http://www.w3.org/1999/xhtml') { // text nodes
var match = node.data.match(re);
if (match) {
var highlight = document.createElement(nodeName || 'span');