fix cli css style selector text lowercase problem by setting svg style content to commandline css content, if available -- this overwrites cloneCssStyles

This commit is contained in:
whyzdev 2017-01-01 22:46:08 -05:00
parent a56fe7a8fe
commit 256c529de8

View File

@ -90,8 +90,9 @@ files.forEach(function(file) {
})
oDOM = oParser.parseFromString(svgContent, "text/xml")
resolveSVGElement(oDOM.firstChild)
setSVGStyle(oDOM.firstChild, options.css)
// traverse the SVG, and replace all foreignObject elements
// can be removed when https://github.com/knsv/mermaid/issues/58 is resolved
@ -184,6 +185,13 @@ function resolveSVGElement(element) {
}
}
function setSVGStyle(svg, css) {
if (!css || !svg) {return}
var styles=svg.getElementsByTagName('style');
if (!styles || styles.length==0) { return }
styles[0].textContent = css;
}
function resolveForeignObjects(element) {
return;
var children