This commit is contained in:
Christian Klemm 2019-10-05 00:46:56 +02:00
parent 723fe84383
commit 92eec664b1
No known key found for this signature in database
GPG Key ID: 57578469FC907C48
2 changed files with 4 additions and 8 deletions

View File

@ -7,7 +7,7 @@ describe('Class diagram', () => {
` `
classDiagram classDiagram
Class01 <|-- AveryLongClass : Cool Class01 <|-- AveryLongClass : Cool
<<interface>> Class01 &lt;&lt;interface&gt;&gt; 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>> &lt;&lt;service&gt;&gt;
int id int id
test() test()
} }

View File

@ -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, '&lt;').replace('/>/g', '&gt;');
};
if (typeof document !== 'undefined') { if (typeof document !== 'undefined') {
/*! /*!
* Wait for document loaded before starting the execution * Wait for document loaded before starting the execution