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' );