From bd94fe6b815ac0a5307a6668b45bcbe97cc02cda Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=B6ren=20Weber?= Date: Sun, 17 Mar 2024 01:45:14 +0100 Subject: [PATCH] generator: fix mermaid zoom after #795 --- static/js/theme.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/static/js/theme.js b/static/js/theme.js index cd000b9d6f..c6ba5f3d76 100644 --- a/static/js/theme.js +++ b/static/js/theme.js @@ -218,10 +218,10 @@ function initMermaid( update, attrs ) { var graph = serializeGraph( parse ); var new_element = document.createElement( 'div' ); - for( var attr of element.attributes ){ + Array.from( element.attributes ).forEach( function( attr ){ new_element.setAttribute( attr.name, attr.value ); element.removeAttribute( attr.name ); - } + }); new_element.classList.add( 'mermaid-container' ); new_element.classList.remove( 'mermaid' ); element.classList.add( 'mermaid' );