Language: JavaScript
Label: safe
CWE: CWE-79 \u2014 Improper Neutralization of Input During Web Page Generation ('Cross-site Scripting')
The product does not neutralize or incorrectly neutralizes user-controllable input before it is placed in output that is used as a web page that is served to other users.

Code:
for(var e=[],k=2;k<c.length;k++){var q=mxUtils.trim(c[k]);"["!=q&&"]"!=q&&"%%"!=q.substring(0,2)&&"##"!=q.substring(0,2)&&(q=c[k].replace(/[-|>]/g," "),""!=mxUtils.trim(q)&&" "==q.charAt(0)&&e.push(q))}return"mindmap\nroot(("+mxUtils.trim(c[1])+"))\n"+e.join("\n")};EditorUi.prototype.extractMermaidDeclaration=function(c){"o\n\n"==c.substring(0,3)&&(c=c.substring(3));var e=c.split("```");e=1<e.length?e:c.split("<pre>");e=1<e.length?e:c.split("~~~");e=1<e.length?e:c.split("%%");e=1<e.length?e:c.split("(Begins)");
e=mxUtils.trim(1>=e.length?c:e[1]);var k=e.split("\n");if(0<k.length&&"mermaid"==mxUtils.trim(k[0])||1<k.length&&0<=mxUtils.indexOf(EditorUi.mermaidDiagramTypes,k[1]))k.shift(),e=mxUtils.trim(k.join("\n")),k=e.split("\n");var q=k[0].split(" ")[0].replace(/:$/,"");try{"mindmap"==q&&2<k.length&&(e=this.extractMermaidMindmap(k))}catch(p){}"@"!=q.charAt(0)&&0>mxUtils.indexOf(EditorUi.mermaidDiagramTypes,q)&&(e="classDiagram\n"+e);EditorUi.debug("EditorUi.extractMermaidDeclaration","\nlines:",k,"\ntype:",
q,"\nvalue:",c,"\ntext:",e);return e};EditorUi.prototype.generateMermaidImage=function(c,e,k,q,p){var t=mxUtils.bind(this,function(C){this.loadingMermaid=!1;null!=q?q(C):this.handleError(C)}),x=mxUtils.bind(this,function(){try{this.loadingMermaid=!1;e=null!=e?e:mxUtils.clone(EditorUi.defaultMermaidConfig);e.securityLevel="strict";e.startOnLoad=!1;Editor.isDarkMode()&&(e.theme="dark");var C=mxUtils.bind(this,function(I){try{if(mxClient.IS_IE||mxClient.IS_IE11)I=I.replace(/ xmlns:\S*="http:\/\/www.w3.org\/XML\/1998\/namespace"/g,