Language: JavaScript
Label: safe
CWE: CWE-78 \u2014 Improper Neutralization of Special Elements used in an OS Command ('OS Command Injection')
The product constructs all or part of an OS command using externally-influenced input from an upstream component, but it does not neutralize or incorrectly neutralizes special elements that could modify the intended OS command when it is sent to a downstream component.

Code:
EditorUi.prototype.extractMermaidMindmap=function(d){for(0<d[1].indexOf("orientation")&&d.splice(1,1);1<d.length&&""==d[1];)d.splice(1,1);for(var f=[],k=2;k<d.length;k++){var u=mxUtils.trim(d[k]);"["!=u&&"]"!=u&&"%%"!=u.substring(0,2)&&"##"!=u.substring(0,2)&&(u=d[k].replace(/[-|>]/g," "),""!=mxUtils.trim(u)&&" "==u.charAt(0)&&f.push(u))}return"mindmap\nroot(("+mxUtils.trim(d[1])+"))\n"+f.join("\n")};EditorUi.prototype.extractMermaidDeclaration=function(d){"o\n\n"==d.substring(0,3)&&(d=d.substring(3));
var f=d.split("```");f=1<f.length?f:d.split("<pre>");f=1<f.length?f:d.split("~~~");f=1<f.length?f:d.split("%%");f=1<f.length?f:d.split("(Begins)");f=mxUtils.trim(1>=f.length?d:f[1]);var k=f.split("\n");if(0<k.length&&"mermaid"==mxUtils.trim(k[0])||1<k.length&&0<=mxUtils.indexOf(EditorUi.mermaidDiagramTypes,k[1]))k.shift(),f=mxUtils.trim(k.join("\n")),k=f.split("\n");var u=k[0].split(" ")[0].replace(/:$/,"");try{"mindmap"==u&&2<k.length&&(f=this.extractMermaidMindmap(k))}catch(z){}"@"!=u.charAt(0)&&
0>mxUtils.indexOf(EditorUi.mermaidDiagramTypes,u)&&(f="classDiagram\n"+f);EditorUi.debug("EditorUi.extractMermaidDeclaration","\nlines:",k,"\ntype:",u,"\nvalue:",d,"\ntext:",f);return f};EditorUi.prototype.removeMermaidComments=function(d){d=d.split("\n");for(var f=[],k=0;k<d.length;k++)"%%"!=d[k].substring(0,2)&&f.push(d[k]);return f.join("\n")};EditorUi.prototype.generateMermaidImage=function(d,f,k,u,z){d=this.removeMermaidComments(d);var B=mxUtils.bind(this,function(K){this.loadingMermaid=!1;null!=