Open somerandomdude opened 9 years ago
See example:
svg = File(doc.path+"exported.svg"); css = "css/style.css"; svg.open('r'); xml = file.read().replace(/^<g[^\n]+\.svg">(.*)<.g>/g,"$1"); xml = xml.replace(/(g|path) id=['\"](?!_x23_)/g,'$1 class="').replace(/_x2._/g,''); svg.close(); file.open('w');//e svg.write('<?xml-stylesheet type="text/css" href="'+css+'"?>\n'+xml);//writeln svg.close();
See example: