mirror of
https://github.com/mermaid-js/mermaid.git
synced 2025-09-24 09:49:46 +02: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:
@@ -92,6 +92,7 @@ files.forEach(function(file) {
|
|||||||
oDOM = oParser.parseFromString(svgContent, "text/xml")
|
oDOM = oParser.parseFromString(svgContent, "text/xml")
|
||||||
|
|
||||||
resolveSVGElement(oDOM.firstChild)
|
resolveSVGElement(oDOM.firstChild)
|
||||||
|
setSVGStyle(oDOM.firstChild, options.css)
|
||||||
|
|
||||||
// traverse the SVG, and replace all foreignObject elements
|
// traverse the SVG, and replace all foreignObject elements
|
||||||
// can be removed when https://github.com/knsv/mermaid/issues/58 is resolved
|
// 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) {
|
function resolveForeignObjects(element) {
|
||||||
return;
|
return;
|
||||||
var children
|
var children
|
||||||
|
Reference in New Issue
Block a user