mirror of
https://github.com/mermaid-js/mermaid.git
synced 2025-01-28 07:03:17 +08:00
test fix
This commit is contained in:
parent
723fe84383
commit
92eec664b1
@ -7,7 +7,7 @@ describe('Class diagram', () => {
|
|||||||
`
|
`
|
||||||
classDiagram
|
classDiagram
|
||||||
Class01 <|-- AveryLongClass : Cool
|
Class01 <|-- AveryLongClass : Cool
|
||||||
<<interface>> Class01
|
<<interface>> Class01
|
||||||
Class03 *-- Class04
|
Class03 *-- Class04
|
||||||
Class05 o-- Class06
|
Class05 o-- Class06
|
||||||
Class07 .. Class08
|
Class07 .. Class08
|
||||||
@ -21,7 +21,7 @@ describe('Class diagram', () => {
|
|||||||
Class01 : int gorilla
|
Class01 : int gorilla
|
||||||
Class08 <--> C2: Cool label
|
Class08 <--> C2: Cool label
|
||||||
class Class10 {
|
class Class10 {
|
||||||
<<service>>
|
<<service>>
|
||||||
int id
|
int id
|
||||||
test()
|
test()
|
||||||
}
|
}
|
||||||
|
@ -19,7 +19,7 @@ const contentLoaded = function() {
|
|||||||
div.className = 'mermaid';
|
div.className = 'mermaid';
|
||||||
div.innerHTML = graphObj.code;
|
div.innerHTML = graphObj.code;
|
||||||
document.getElementsByTagName('body')[0].appendChild(div);
|
document.getElementsByTagName('body')[0].appendChild(div);
|
||||||
global.mermaid.initialize(escapeDiagram(graphObj.mermaid));
|
global.mermaid.initialize(graphObj.mermaid);
|
||||||
// console.log('graphObj.mermaid', graphObj.mermaid)
|
// console.log('graphObj.mermaid', graphObj.mermaid)
|
||||||
global.mermaid.init();
|
global.mermaid.init();
|
||||||
}
|
}
|
||||||
@ -36,7 +36,7 @@ const contentLoadedApi = function() {
|
|||||||
div.className = 'mermaid';
|
div.className = 'mermaid';
|
||||||
// div.innerHTML = graphObj.code
|
// div.innerHTML = graphObj.code
|
||||||
document.getElementsByTagName('body')[0].appendChild(div);
|
document.getElementsByTagName('body')[0].appendChild(div);
|
||||||
global.mermaid.initialize(escapeDiagram(graphObj.mermaid));
|
global.mermaid.initialize(graphObj.mermaid);
|
||||||
|
|
||||||
mermaid2.render(
|
mermaid2.render(
|
||||||
'newid',
|
'newid',
|
||||||
@ -51,10 +51,6 @@ const contentLoadedApi = function() {
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
const escapeDiagram = function(diagram) {
|
|
||||||
return diagram.replace(/</g, '<').replace('/>/g', '>');
|
|
||||||
};
|
|
||||||
|
|
||||||
if (typeof document !== 'undefined') {
|
if (typeof document !== 'undefined') {
|
||||||
/*!
|
/*!
|
||||||
* Wait for document loaded before starting the execution
|
* Wait for document loaded before starting the execution
|
||||||
|
Loading…
x
Reference in New Issue
Block a user