mirror of
https://github.com/mermaid-js/mermaid.git
synced 2025-11-14 17:54:13 +01:00
fix gantt chart cli configuration one more time missing }; make sequenceConfig cli configuration work; added guantt and sequence files in tape cli output tests
This commit is contained in:
@@ -211,7 +211,7 @@ function executeInPage(data) {
|
||||
var xmlSerializer = new XMLSerializer()
|
||||
, contents = data.contents
|
||||
, sequenceConfig = JSON.stringify(data.sequenceConfig)
|
||||
, ganttConfig = JSON.stringify(data.ganttConfig).replace(/"(function.*)}"/, "$1")
|
||||
, ganttConfig = JSON.stringify(data.ganttConfig).replace(/"(function.*})"/, "$1")
|
||||
, toRemove
|
||||
, el
|
||||
, elContent
|
||||
@@ -222,35 +222,28 @@ function executeInPage(data) {
|
||||
, height
|
||||
, confWidth = data.confWidth
|
||||
|
||||
toRemove = document.getElementsByClassName('mermaid')
|
||||
var toRemove = document.getElementsByClassName('mermaid')
|
||||
if (toRemove && toRemove.length) {
|
||||
for (var i = 0, len = toRemove.length; i < len; i++) {
|
||||
toRemove[i].parentNode.removeChild(toRemove[i])
|
||||
}
|
||||
}
|
||||
|
||||
el = document.createElement("div")
|
||||
var el = document.createElement("div")
|
||||
el.className = 'mermaid'
|
||||
elContent = document.createTextNode(contents)
|
||||
el.appendChild(elContent)
|
||||
//el.innerText = '<b>hello</b>\uD800' //contents;
|
||||
|
||||
el.appendChild(document.createTextNode(contents))
|
||||
document.body.appendChild(el)
|
||||
|
||||
var config = {
|
||||
sequenceDiagram: sequenceConfig,
|
||||
sequenceDiagram: JSON.parse(sequenceConfig),
|
||||
flowchart: {useMaxWidth: false},
|
||||
logLevel: 1
|
||||
};
|
||||
|
||||
mermaid.initialize(config);
|
||||
|
||||
//console.log('after initialize',sequenceConfig);
|
||||
|
||||
sc = document.createElement("script")
|
||||
scContent = document.createTextNode('mermaid.ganttConfig = ' + ganttConfig + ';')
|
||||
sc.appendChild(scContent)
|
||||
|
||||
var sc = document.createElement("script")
|
||||
sc.appendChild(document.createTextNode('mermaid.ganttConfig = ' + ganttConfig + ';'))
|
||||
document.body.appendChild(sc)
|
||||
|
||||
mermaid.init();
|
||||
|
||||
Reference in New Issue
Block a user