mirror of
https://github.com/mermaid-js/mermaid.git
synced 2025-01-14 06:43:25 +08:00
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:
parent
a56fe7a8fe
commit
256c529de8
@ -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
|
||||
|
Loading…
x
Reference in New Issue
Block a user