mirror of
https://github.com/mermaid-js/mermaid.git
synced 2025-01-14 06:43:25 +08:00
Fix for issue #126
This commit is contained in:
parent
f4b2211f8f
commit
3fedc1263c
27
dist/mermaid.full.js
vendored
27
dist/mermaid.full.js
vendored
@ -31042,18 +31042,29 @@ module.exports.cloneCssStyles = function(svg, classes){
|
||||
for (var i = 0; i < sheets.length; i++) {
|
||||
// Avoid multiple inclusion on pages with multiple graphs
|
||||
if (sheets[i].title !== 'mermaid-svg-internal-css') {
|
||||
var rules = sheets[i].cssRules;
|
||||
if(rules !== null) {
|
||||
for (var j = 0; j < rules.length; j++) {
|
||||
var rule = rules[j];
|
||||
if (typeof(rule.style) !== 'undefined') {
|
||||
var elems = svg.querySelectorAll(rule.selectorText);
|
||||
if (elems.length > 0) {
|
||||
usedStyles += rule.selectorText + " { " + rule.style.cssText + " }\n";
|
||||
try {
|
||||
|
||||
var rules = sheets[i].cssRules;
|
||||
if (rules !== null) {
|
||||
for (var j = 0; j < rules.length; j++) {
|
||||
var rule = rules[j];
|
||||
if (typeof(rule.style) !== 'undefined') {
|
||||
var elems;
|
||||
elems = svg.querySelectorAll(rule.selectorText);
|
||||
if (elems.length > 0) {
|
||||
usedStyles += rule.selectorText + " { " + rule.style.cssText + " }\n";
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
catch(err) {
|
||||
if(typeof console !== 'undefined'){
|
||||
if(console.warn !== 'undefined'){
|
||||
console.warn('Invalid CSS selector "' + rule.selectorText + '"', err);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
2
dist/mermaid.full.min.js
vendored
2
dist/mermaid.full.min.js
vendored
File diff suppressed because one or more lines are too long
27
dist/mermaid.slim.js
vendored
27
dist/mermaid.slim.js
vendored
@ -31010,18 +31010,29 @@ module.exports.cloneCssStyles = function(svg, classes){
|
||||
for (var i = 0; i < sheets.length; i++) {
|
||||
// Avoid multiple inclusion on pages with multiple graphs
|
||||
if (sheets[i].title !== 'mermaid-svg-internal-css') {
|
||||
var rules = sheets[i].cssRules;
|
||||
if(rules !== null) {
|
||||
for (var j = 0; j < rules.length; j++) {
|
||||
var rule = rules[j];
|
||||
if (typeof(rule.style) !== 'undefined') {
|
||||
var elems = svg.querySelectorAll(rule.selectorText);
|
||||
if (elems.length > 0) {
|
||||
usedStyles += rule.selectorText + " { " + rule.style.cssText + " }\n";
|
||||
try {
|
||||
|
||||
var rules = sheets[i].cssRules;
|
||||
if (rules !== null) {
|
||||
for (var j = 0; j < rules.length; j++) {
|
||||
var rule = rules[j];
|
||||
if (typeof(rule.style) !== 'undefined') {
|
||||
var elems;
|
||||
elems = svg.querySelectorAll(rule.selectorText);
|
||||
if (elems.length > 0) {
|
||||
usedStyles += rule.selectorText + " { " + rule.style.cssText + " }\n";
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
catch(err) {
|
||||
if(typeof console !== 'undefined'){
|
||||
if(console.warn !== 'undefined'){
|
||||
console.warn('Invalid CSS selector "' + rule.selectorText + '"', err);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
2
dist/mermaid.slim.min.js
vendored
2
dist/mermaid.slim.min.js
vendored
File diff suppressed because one or more lines are too long
27
src/utils.js
27
src/utils.js
@ -47,18 +47,29 @@ module.exports.cloneCssStyles = function(svg, classes){
|
||||
for (var i = 0; i < sheets.length; i++) {
|
||||
// Avoid multiple inclusion on pages with multiple graphs
|
||||
if (sheets[i].title !== 'mermaid-svg-internal-css') {
|
||||
var rules = sheets[i].cssRules;
|
||||
if(rules !== null) {
|
||||
for (var j = 0; j < rules.length; j++) {
|
||||
var rule = rules[j];
|
||||
if (typeof(rule.style) !== 'undefined') {
|
||||
var elems = svg.querySelectorAll(rule.selectorText);
|
||||
if (elems.length > 0) {
|
||||
usedStyles += rule.selectorText + " { " + rule.style.cssText + " }\n";
|
||||
try {
|
||||
|
||||
var rules = sheets[i].cssRules;
|
||||
if (rules !== null) {
|
||||
for (var j = 0; j < rules.length; j++) {
|
||||
var rule = rules[j];
|
||||
if (typeof(rule.style) !== 'undefined') {
|
||||
var elems;
|
||||
elems = svg.querySelectorAll(rule.selectorText);
|
||||
if (elems.length > 0) {
|
||||
usedStyles += rule.selectorText + " { " + rule.style.cssText + " }\n";
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
catch(err) {
|
||||
if(typeof console !== 'undefined'){
|
||||
if(console.warn !== 'undefined'){
|
||||
console.warn('Invalid CSS selector "' + rule.selectorText + '"', err);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -24,6 +24,8 @@
|
||||
}
|
||||
</style>
|
||||
<link rel="stylesheet" href="seq.css"/>
|
||||
<lnk rel="stylesheet" href="https://raw.githubusercontent.com/knsv/mermaid/master/dist/mermaid.forest.css"/>
|
||||
<link rel="stylesheet" href="../dist/mermaid.forest.css"/>
|
||||
</head>
|
||||
<body>
|
||||
<div class="mermaid">
|
||||
|
Loading…
x
Reference in New Issue
Block a user