diff --git a/README.md b/README.md index 4d86b6a43..929ccf753 100644 --- a/README.md +++ b/README.md @@ -15,7 +15,7 @@ English | [简体中文](./README.zh-CN.md) ## About -Mermaid is a Javascript based diagramming and charting tool that uses Markdown-inspired text definitions and a renderer to create and modify complex diagrams. The main purpose of Mermaid is to help documentation catch up with development. +Mermaid is a JavaScript based diagramming and charting tool that uses Markdown-inspired text definitions and a renderer to create and modify complex diagrams. The main purpose of Mermaid is to help documentation catch up with development. > Doc-Rot is a Catch-22 that Mermaid helps to solve. diff --git a/cypress/e2e/other/configuration.spec.js b/cypress/e2e/other/configuration.spec.js index a92aae52b..a67758d9c 100644 --- a/cypress/e2e/other/configuration.spec.js +++ b/cypress/e2e/other/configuration.spec.js @@ -41,7 +41,7 @@ describe('Configuration', () => { .should('exist') .and('include', 'url(#'); }); - it('should handle arrowMarkerAbsolute excplicitly set to false', () => { + it('should handle arrowMarkerAbsolute explicitly set to false', () => { renderGraph( `graph TD A[Christmas] -->|Get money| B(Go shopping) @@ -63,7 +63,7 @@ describe('Configuration', () => { .should('exist') .and('include', 'url(#'); }); - it('should handle arrowMarkerAbsolute excplicitly set to "false" as false', () => { + it('should handle arrowMarkerAbsolute explicitly set to "false" as false', () => { renderGraph( `graph TD A[Christmas] -->|Get money| B(Go shopping) diff --git a/cypress/e2e/other/rerender.spec.js b/cypress/e2e/other/rerender.spec.js index 8e8c68694..f160a2e27 100644 --- a/cypress/e2e/other/rerender.spec.js +++ b/cypress/e2e/other/rerender.spec.js @@ -1,5 +1,5 @@ describe('Rerendering', () => { - it('should be able to render after an error has occured', () => { + it('should be able to render after an error has occurred', () => { const url = 'http://localhost:9000/render-after-error.html'; cy.viewport(1440, 1024); cy.visit(url); diff --git a/cypress/e2e/other/xss.spec.js b/cypress/e2e/other/xss.spec.js index 6226feaeb..912354f7d 100644 --- a/cypress/e2e/other/xss.spec.js +++ b/cypress/e2e/other/xss.spec.js @@ -60,52 +60,52 @@ describe('XSS', () => { cy.wait(1000); cy.get('#the-malware').should('not.exist'); }); - it('should not allow maniplulating htmlLabels into a false positive', () => { + it('should not allow manipulating htmlLabels into a false positive', () => { cy.visit('http://localhost:9000/xss4.html'); cy.wait(1000); cy.get('#the-malware').should('not.exist'); }); - it('should not allow maniplulating antiscript to run javascript', () => { + it('should not allow manipulating antiscript to run javascript', () => { cy.visit('http://localhost:9000/xss5.html'); cy.wait(1000); cy.get('#the-malware').should('not.exist'); }); - it('should not allow maniplulating antiscript to run javascript using onerror', () => { + it('should not allow manipulating antiscript to run javascript using onerror', () => { cy.visit('http://localhost:9000/xss6.html'); cy.wait(1000); cy.get('#the-malware').should('not.exist'); }); - it('should not allow maniplulating antiscript to run javascript using onerror in state diagrams with dagre wrapper', () => { + it('should not allow manipulating antiscript to run javascript using onerror in state diagrams with dagre wrapper', () => { cy.visit('http://localhost:9000/xss8.html'); cy.wait(1000); cy.get('#the-malware').should('not.exist'); }); - it('should not allow maniplulating antiscript to run javascript using onerror in state diagrams with dagre d3', () => { + it('should not allow manipulating antiscript to run javascript using onerror in state diagrams with dagre d3', () => { cy.visit('http://localhost:9000/xss9.html'); cy.wait(1000); cy.get('#the-malware').should('not.exist'); }); - it('should not allow maniplulating antiscript to run javascript using onerror in state diagrams with dagre d3', () => { + it('should not allow manipulating antiscript to run javascript using onerror in state diagrams with dagre d3', () => { cy.visit('http://localhost:9000/xss10.html'); cy.wait(1000); cy.get('#the-malware').should('not.exist'); }); - it('should not allow maniplulating antiscript to run javascript using onerror in state diagrams with dagre d3', () => { + it('should not allow manipulating antiscript to run javascript using onerror in state diagrams with dagre d3', () => { cy.visit('http://localhost:9000/xss11.html'); cy.wait(1000); cy.get('#the-malware').should('not.exist'); }); - it('should not allow maniplulating antiscript to run javascript using onerror in state diagrams with dagre d3', () => { + it('should not allow manipulating antiscript to run javascript using onerror in state diagrams with dagre d3', () => { cy.visit('http://localhost:9000/xss12.html'); cy.wait(1000); cy.get('#the-malware').should('not.exist'); }); - it('should not allow maniplulating antiscript to run javascript using onerror in state diagrams with dagre d3', () => { + it('should not allow manipulating antiscript to run javascript using onerror in state diagrams with dagre d3', () => { cy.visit('http://localhost:9000/xss13.html'); cy.wait(1000); cy.get('#the-malware').should('not.exist'); }); - it('should not allow maniplulating antiscript to run javascript iframes in class diagrams', () => { + it('should not allow manipulating antiscript to run javascript iframes in class diagrams', () => { cy.visit('http://localhost:9000/xss14.html'); cy.wait(1000); cy.get('#the-malware').should('not.exist'); diff --git a/cypress/e2e/rendering/classDiagram-v2.spec.js b/cypress/e2e/rendering/classDiagram-v2.spec.js index fd373da73..d285a9237 100644 --- a/cypress/e2e/rendering/classDiagram-v2.spec.js +++ b/cypress/e2e/rendering/classDiagram-v2.spec.js @@ -381,7 +381,7 @@ describe('Class diagram V2', () => { cy.get('svg'); }); - it('16b: should handle the direction statemnent with TB', () => { + it('16b: should handle the direction statement with TB', () => { imgSnapshotTest( ` classDiagram @@ -406,7 +406,7 @@ describe('Class diagram V2', () => { cy.get('svg'); }); - it('18: should handle the direction statemnent with LR', () => { + it('18: should handle the direction statement with LR', () => { imgSnapshotTest( ` classDiagram @@ -430,7 +430,7 @@ describe('Class diagram V2', () => { ); cy.get('svg'); }); - it('17a: should handle the direction statemnent with BT', () => { + it('17a: should handle the direction statement with BT', () => { imgSnapshotTest( ` classDiagram @@ -454,7 +454,7 @@ describe('Class diagram V2', () => { ); cy.get('svg'); }); - it('17b: should handle the direction statemment with RL', () => { + it('17b: should handle the direction statement with RL', () => { imgSnapshotTest( ` classDiagram diff --git a/cypress/e2e/rendering/conf-and-directives.spec.js b/cypress/e2e/rendering/conf-and-directives.spec.js index 76de5871d..3fc0f7f02 100644 --- a/cypress/e2e/rendering/conf-and-directives.spec.js +++ b/cypress/e2e/rendering/conf-and-directives.spec.js @@ -16,7 +16,7 @@ describe('Configuration and directives - nodes should be light blue', () => { ); cy.get('svg'); }); - it('Settigns from intitialize - nodes should be green', () => { + it('Settings from initialize - nodes should be green', () => { imgSnapshotTest( ` graph TD @@ -30,7 +30,7 @@ graph TD ); cy.get('svg'); }); - it('Settings from initialize overriding themeVariable - nodes shold be red', () => { + it('Settings from initialize overriding themeVariable - nodes should be red', () => { imgSnapshotTest( ` diff --git a/cypress/e2e/rendering/sequencediagram.spec.js b/cypress/e2e/rendering/sequencediagram.spec.js index 1122a3009..c110f05ad 100644 --- a/cypress/e2e/rendering/sequencediagram.spec.js +++ b/cypress/e2e/rendering/sequencediagram.spec.js @@ -76,7 +76,7 @@ context('Sequence diagram', () => { imgSnapshotTest( ` sequenceDiagram - Alice->>Bob: Extremely utterly long line of longness which had preivously overflown the actor box as it is much longer than what it should be + Alice->>Bob: Extremely utterly long line of longness which had previously overflown the actor box as it is much longer than what it should be loop Loopy Bob->>Alice: Pasten end `, @@ -143,7 +143,7 @@ context('Sequence diagram', () => { imgSnapshotTest( ` sequenceDiagram - participant A as Extremely utterly long line of longness which had preivously overflown the actor box as it is much longer than what it should be + participant A as Extremely utterly long line of longness which had previously overflown the actor box as it is much longer than what it should be A->>Bob: Hola Bob-->A: Pasten ! `, @@ -154,7 +154,7 @@ context('Sequence diagram', () => { imgSnapshotTest( ` sequenceDiagram - participant A as wrap:Extremely utterly long line of longness which had preivously overflown the actor box as it is much longer than what it should be + participant A as wrap:Extremely utterly long line of longness which had previously overflown the actor box as it is much longer than what it should be A->>Bob: Hola Bob-->A: Pasten ! `, @@ -166,7 +166,7 @@ context('Sequence diagram', () => { ` %%{init: {'config': {'wrap': true }}}%% sequenceDiagram - participant A as Extremely utterly long line of longness which had preivously overflown the actor box as it is much longer than what it should be + participant A as Extremely utterly long line of longness which had previously overflown the actor box as it is much longer than what it should be A->>Bob: Hola Bob-->A: Pasten ! `, @@ -190,7 +190,7 @@ context('Sequence diagram', () => { ` sequenceDiagram Alice->>Bob: Hola - Note left of Alice: Extremely utterly long line of longness which had preivously overflown the actor box as it is much longer than what it should be + Note left of Alice: Extremely utterly long line of longness which had previously overflown the actor box as it is much longer than what it should be Bob->>Alice: I'm short though `, {} @@ -201,7 +201,7 @@ context('Sequence diagram', () => { ` sequenceDiagram Alice->>Bob: Hola - Note left of Alice:wrap: Extremely utterly long line of longness which had preivously overflown the actor box as it is much longer than what it should be + Note left of Alice:wrap: Extremely utterly long line of longness which had previously overflown the actor box as it is much longer than what it should be Bob->>Alice: I'm short though `, {} @@ -212,7 +212,7 @@ context('Sequence diagram', () => { ` sequenceDiagram Alice->>Bob: Hola - Note right of Alice: Extremely utterly long line of longness which had preivously overflown the actor box as it is much longer than what it should be + Note right of Alice: Extremely utterly long line of longness which had previously overflown the actor box as it is much longer than what it should be Bob->>Alice: I'm short though `, {} @@ -223,7 +223,7 @@ context('Sequence diagram', () => { ` sequenceDiagram Alice->>Bob: Hola - Note right of Alice:wrap: Extremely utterly long line of longness which had preivously overflown the actor box as it is much longer than what it should be + Note right of Alice:wrap: Extremely utterly long line of longness which had previously overflown the actor box as it is much longer than what it should be Bob->>Alice: I'm short though `, {} @@ -234,7 +234,7 @@ context('Sequence diagram', () => { ` sequenceDiagram Alice->>Bob: Hola - Note over Alice: Extremely utterly long line of longness which had preivously overflown the actor box as it is much longer than what it should be + Note over Alice: Extremely utterly long line of longness which had previously overflown the actor box as it is much longer than what it should be Bob->>Alice: I'm short though `, {} @@ -245,7 +245,7 @@ context('Sequence diagram', () => { ` sequenceDiagram Alice->>Bob: Hola - Note over Alice:wrap: Extremely utterly long line of longness which had preivously overflown the actor box as it is much longer than what it should be + Note over Alice:wrap: Extremely utterly long line of longness which had previously overflown the actor box as it is much longer than what it should be Bob->>Alice: I'm short though `, {} @@ -255,7 +255,7 @@ context('Sequence diagram', () => { imgSnapshotTest( ` sequenceDiagram - Alice->>Bob: Extremely utterly long line of longness which had preivously overflown the actor box as it is much longer than what it should be + Alice->>Bob: Extremely utterly long line of longness which had previously overflown the actor box as it is much longer than what it should be Bob->>Alice: I'm short though `, {} @@ -265,7 +265,7 @@ context('Sequence diagram', () => { imgSnapshotTest( ` sequenceDiagram - Alice->>Bob:wrap:Extremely utterly long line of longness which had preivously overflown the actor box as it is much longer than what it should be + Alice->>Bob:wrap:Extremely utterly long line of longness which had previously overflown the actor box as it is much longer than what it should be Bob->>Alice: I'm short though `, {} @@ -276,7 +276,7 @@ context('Sequence diagram', () => { ` sequenceDiagram Alice->>Bob: I'm short - Bob->>Alice: Extremely utterly long line of longness which had preivously overflown the actor box as it is much longer than what it should be + Bob->>Alice: Extremely utterly long line of longness which had previously overflown the actor box as it is much longer than what it should be `, {} ); @@ -286,7 +286,7 @@ context('Sequence diagram', () => { ` sequenceDiagram Alice->>Bob: I'm short - Bob->>Alice:wrap: Extremely utterly long line of longness which had preivously overflown the actor box as it is much longer than what it should be + Bob->>Alice:wrap: Extremely utterly long line of longness which had previously overflown the actor box as it is much longer than what it should be `, {} ); diff --git a/cypress/platform/current2.html b/cypress/platform/current2.html index 16ddb4a99..6f9c2184a 100644 --- a/cypress/platform/current2.html +++ b/cypress/platform/current2.html @@ -35,7 +35,7 @@ flowchart BT
sequenceDiagram - Alice->>Bob:Extremely utterly long line of longness which had preivously overflown the actor box as it is much longer than what it should be + Alice->>Bob:Extremely utterly long line of longness which had previously overflown the actor box as it is much longer than what it should be Bob->>Alice: I'm short though
diff --git a/cypress/platform/exploit.js b/cypress/platform/exploit.js index 2b4b0baa5..ff3c918dc 100644 --- a/cypress/platform/exploit.js +++ b/cypress/platform/exploit.js @@ -3,4 +3,4 @@ div.id = 'the-malware'; div.className = 'malware'; div.innerHTML = 'XSS Succeeded'; parent.document.getElementsByTagName('body')[0].appendChild(div); -throw new Error('XSS Succeded'); +throw new Error('XSS Succeeded'); diff --git a/cypress/platform/xss.html b/cypress/platform/xss.html index e3a4c4351..3938c5aae 100644 --- a/cypress/platform/xss.html +++ b/cypress/platform/xss.html @@ -31,7 +31,7 @@ document.getElementsByTagName('body')[0].appendChild(div); // const el = document.querySelector('.mermaid'); // el.parentNode.removeChild(el); - throw new Error('XSS Succeded'); + throw new Error('XSS Succeeded'); } diff --git a/cypress/platform/xss10.html b/cypress/platform/xss10.html index b78817a78..1a863b4b7 100644 --- a/cypress/platform/xss10.html +++ b/cypress/platform/xss10.html @@ -84,7 +84,7 @@ div.className = 'malware'; div.innerHTML = 'XSS Succeeded'; document.getElementsByTagName('body')[0].appendChild(div); - throw new Error('XSS Succeded'); + throw new Error('XSS Succeeded'); } var diagram = 'classDiagram\n'; @@ -105,4 +105,3 @@ mermaid.render('diagram', diagram, (res) => { - diff --git a/cypress/platform/xss11.html b/cypress/platform/xss11.html index 51d0074d9..8eadfa43b 100644 --- a/cypress/platform/xss11.html +++ b/cypress/platform/xss11.html @@ -84,7 +84,7 @@ div.className = 'malware'; div.innerHTML = 'XSS Succeeded'; document.getElementsByTagName('body')[0].appendChild(div); - throw new Error('XSS Succeded'); + throw new Error('XSS Succeeded'); } var diagram = 'stateDiagram-v2\n'; @@ -103,4 +103,3 @@ mermaid.render('diagram', diagram, (res) => { - diff --git a/cypress/platform/xss12.html b/cypress/platform/xss12.html index 8cdbc88c1..ff3728542 100644 --- a/cypress/platform/xss12.html +++ b/cypress/platform/xss12.html @@ -84,7 +84,7 @@ div.className = 'malware'; div.innerHTML = 'XSS Succeeded'; document.getElementsByTagName('body')[0].appendChild(div); - throw new Error('XSS Succeded'); + throw new Error('XSS Succeeded'); } var diagram = 'stateDiagram-v2\n'; @@ -103,4 +103,3 @@ mermaid.render('diagram', diagram, (res) => { - diff --git a/cypress/platform/xss13.html b/cypress/platform/xss13.html index ca020c218..f3e0ecc49 100644 --- a/cypress/platform/xss13.html +++ b/cypress/platform/xss13.html @@ -84,7 +84,7 @@ div.className = 'malware'; div.innerHTML = 'XSS Succeeded'; document.getElementsByTagName('body')[0].appendChild(div); - throw new Error('XSS Succeded'); + throw new Error('XSS Succeeded'); } var diagram = 'stateDiagram-v2\n'; @@ -103,4 +103,3 @@ mermaid.render('diagram', diagram, (res) => { - diff --git a/cypress/platform/xss14.html b/cypress/platform/xss14.html index 68b61a809..75492bbf4 100644 --- a/cypress/platform/xss14.html +++ b/cypress/platform/xss14.html @@ -84,7 +84,7 @@ div.className = 'malware'; div.innerHTML = 'XSS Succeeded'; document.getElementsByTagName('body')[0].appendChild(div); - throw new Error('XSS Succeded'); + throw new Error('XSS Succeeded'); } var diagram = 'classDiagram\n'; @@ -105,4 +105,3 @@ mermaid.render('diagram', diagram, (res) => { - diff --git a/cypress/platform/xss15.html b/cypress/platform/xss15.html index 94506def5..1d7cfd5e7 100644 --- a/cypress/platform/xss15.html +++ b/cypress/platform/xss15.html @@ -84,7 +84,7 @@ div.className = 'malware'; div.innerHTML = 'XSS Succeeded'; document.getElementsByTagName('body')[0].appendChild(div); - throw new Error('XSS Succeded'); + throw new Error('XSS Succeeded'); } var diagram = `sequenceDiagram @@ -104,4 +104,3 @@ mermaid.render('diagram', diagram, (res) => { - diff --git a/cypress/platform/xss16.html b/cypress/platform/xss16.html index 076ed3c34..69355aea3 100644 --- a/cypress/platform/xss16.html +++ b/cypress/platform/xss16.html @@ -84,7 +84,7 @@ div.className = 'malware'; div.innerHTML = 'XSS Succeeded'; document.getElementsByTagName('body')[0].appendChild(div); - throw new Error('XSS Succeded'); + throw new Error('XSS Succeeded'); } var diagram = `sequenceDiagram @@ -103,4 +103,3 @@ mermaid.render('diagram', diagram, (res) => { - diff --git a/cypress/platform/xss17.html b/cypress/platform/xss17.html index 26f6a208a..874dcb7af 100644 --- a/cypress/platform/xss17.html +++ b/cypress/platform/xss17.html @@ -84,7 +84,7 @@ div.className = 'malware'; div.innerHTML = 'XSS Succeeded'; document.getElementsByTagName('body')[0].appendChild(div); - throw new Error('XSS Succeded'); + throw new Error('XSS Succeeded'); } var diagram = `sequenceDiagram @@ -103,4 +103,3 @@ mermaid.render('diagram', diagram, (res) => { - diff --git a/cypress/platform/xss18.html b/cypress/platform/xss18.html index 5dc7df621..c93e603b1 100644 --- a/cypress/platform/xss18.html +++ b/cypress/platform/xss18.html @@ -84,7 +84,7 @@ div.className = 'malware'; div.innerHTML = 'XSS Succeeded'; document.getElementsByTagName('body')[0].appendChild(div); - throw new Error('XSS Succeded'); + throw new Error('XSS Succeeded'); } var diagram = `classDiagram @@ -102,4 +102,3 @@ mermaid.render('diagram', diagram, (res) => { - diff --git a/cypress/platform/xss19.html b/cypress/platform/xss19.html index b5c5a86e9..cce0d97a4 100644 --- a/cypress/platform/xss19.html +++ b/cypress/platform/xss19.html @@ -84,7 +84,7 @@ div.className = 'malware'; div.innerHTML = 'XSS Succeeded'; document.getElementsByTagName('body')[0].appendChild(div); - throw new Error('XSS Succeded'); + throw new Error('XSS Succeeded'); } var diagram = `classDiagram @@ -104,4 +104,3 @@ mermaid.render('diagram', diagram, (res) => { - diff --git a/cypress/platform/xss2.html b/cypress/platform/xss2.html index 3f11b8f95..73b3a2624 100644 --- a/cypress/platform/xss2.html +++ b/cypress/platform/xss2.html @@ -28,7 +28,7 @@ div.className = 'malware'; div.innerHTML = 'XSS Succeeded'; document.getElementsByTagName('body')[0].appendChild(div); - throw new Error('XSS Succeded'); + throw new Error('XSS Succeeded'); } diff --git a/cypress/platform/xss20.html b/cypress/platform/xss20.html index 33d4dfccb..b782d52f3 100644 --- a/cypress/platform/xss20.html +++ b/cypress/platform/xss20.html @@ -84,7 +84,7 @@ div.className = 'malware'; div.innerHTML = 'XSS Succeeded'; document.getElementsByTagName('body')[0].appendChild(div); - throw new Error('XSS Succeded'); + throw new Error('XSS Succeeded'); } // var diagram = ` graph TD @@ -102,4 +102,3 @@ mermaid.render('diagram', diagram, (res) => { - diff --git a/cypress/platform/xss21.html b/cypress/platform/xss21.html index 9a88d7afa..ed243441f 100644 --- a/cypress/platform/xss21.html +++ b/cypress/platform/xss21.html @@ -84,7 +84,7 @@ div.className = 'malware'; div.innerHTML = 'XSS Succeeded'; document.getElementsByTagName('body')[0].appendChild(div); - throw new Error('XSS Succeded'); + throw new Error('XSS Succeeded'); } // var diagram = ` graph TD @@ -102,4 +102,3 @@ mermaid.render('diagram', diagram, (res) => { - diff --git a/cypress/platform/xss3.html b/cypress/platform/xss3.html index 015aa0e1f..c2e1113fa 100644 --- a/cypress/platform/xss3.html +++ b/cypress/platform/xss3.html @@ -28,7 +28,7 @@ div.className = 'malware'; div.innerHTML = 'XSS Succeeded'; document.getElementsByTagName('body')[0].appendChild(div); - throw new Error('XSS Succeded'); + throw new Error('XSS Succeeded'); } diff --git a/cypress/platform/xss5.html b/cypress/platform/xss5.html index b1fd610c6..86d45eeec 100644 --- a/cypress/platform/xss5.html +++ b/cypress/platform/xss5.html @@ -84,7 +84,7 @@ div.className = 'malware'; div.innerHTML = 'XSS Succeeded'; document.getElementsByTagName('body')[0].appendChild(div); - throw new Error('XSS Succeded'); + throw new Error('XSS Succeeded'); } var diagram = 'graph LR\n'; diagram += 'B-->D(" { - diff --git a/cypress/platform/xss6.html b/cypress/platform/xss6.html index 2205b2f06..32eca4313 100644 --- a/cypress/platform/xss6.html +++ b/cypress/platform/xss6.html @@ -84,7 +84,7 @@ div.className = 'malware'; div.innerHTML = 'XSS Succeeded'; document.getElementsByTagName('body')[0].appendChild(div); - throw new Error('XSS Succeded'); + throw new Error('XSS Succeeded'); } var diagram = 'graph LR\n'; diagram += 'A()'; @@ -98,4 +98,3 @@ mermaid.render('diagram', diagram, (res) => { - diff --git a/cypress/platform/xss7.html b/cypress/platform/xss7.html index cbf795d18..51fcb3ddf 100644 --- a/cypress/platform/xss7.html +++ b/cypress/platform/xss7.html @@ -84,7 +84,7 @@ div.className = 'malware'; div.innerHTML = 'XSS Succeeded'; document.getElementsByTagName('body')[0].appendChild(div); - throw new Error('XSS Succeded'); + throw new Error('XSS Succeeded'); } var diagram = 'graph LR\n'; diagram += " B( { - diff --git a/cypress/platform/xss8.html b/cypress/platform/xss8.html index 36899a8ff..97709ffc6 100644 --- a/cypress/platform/xss8.html +++ b/cypress/platform/xss8.html @@ -84,7 +84,7 @@ div.className = 'malware'; div.innerHTML = 'XSS Succeeded'; document.getElementsByTagName('body')[0].appendChild(div); - throw new Error('XSS Succeded'); + throw new Error('XSS Succeeded'); } var diagram = 'stateDiagram-v2\n'; @@ -99,4 +99,3 @@ mermaid.render('diagram', diagram, (res) => { - diff --git a/cypress/platform/xss9.html b/cypress/platform/xss9.html index 6b61d5810..7d06e988e 100644 --- a/cypress/platform/xss9.html +++ b/cypress/platform/xss9.html @@ -84,7 +84,7 @@ div.className = 'malware'; div.innerHTML = 'XSS Succeeded'; document.getElementsByTagName('body')[0].appendChild(div); - throw new Error('XSS Succeded'); + throw new Error('XSS Succeeded'); } var diagram = 'stateDiagram-v2\n'; @@ -99,4 +99,3 @@ mermaid.render('diagram', diagram, (res) => { - diff --git a/demos/index.html b/demos/index.html index 0abe627a7..2aa749b9d 100644 --- a/demos/index.html +++ b/demos/index.html @@ -65,7 +65,7 @@ Enterprise_Boundary(b0, "BankBoundary0") { Person(customer, Customer, "A customer of the bank, with personal bank accounts") Container_Boundary(c1, "Internet Banking") { - Container(spa, "Single-Page App", "JavaScript, Angular", "Provides all the Internet banking functionality to cutomers via their web browser") + Container(spa, "Single-Page App", "JavaScript, Angular", "Provides all the Internet banking functionality to customers via their web browser") Container_Ext(mobile_app, "Mobile App", "C#, Xamarin", "Provides a limited subset of the Internet banking functionality to customers via their mobile device") Container(web_app, "Web Application", "Java, Spring MVC", "Delivers the static content and the Internet banking SPA") ContainerDb(database, "Database", "SQL Database", "Stores user registration information, hashed auth credentials, access logs, etc.") @@ -99,7 +99,7 @@ Enterprise_Boundary(b0, "BankBoundary0") { System_Ext(mbs, "Mainframe Banking System", "Stores all of the core banking information about customers, accounts, transactions, etc.") Container_Boundary(api, "API Application") { - Component(sign, "Sign In Controller", "MVC Rest Controlle", "Allows users to sign in to the internet banking system") + Component(sign, "Sign In Controller", "MVC Rest Controller", "Allows users to sign in to the internet banking system") Component(accounts, "Accounts Summary Controller", "MVC Rest Controller", "Provides customers with a summary of their bank accounts") Component(security, "Security Component", "Spring Bean", "Provides functionality related to singing in, changing passwords, etc.") Component(mbsfacade, "Mainframe Banking System Facade", "Spring Bean", "A facade onto the mainframe banking system.") diff --git a/docs/Setup.md b/docs/Setup.md index 7ef31381e..65e8ef771 100644 --- a/docs/Setup.md +++ b/docs/Setup.md @@ -118,7 +118,7 @@ Default value: ['secure', 'securityLevel', 'startOnLoad', 'maxTextSize'] This option controls if the generated ids of nodes in the SVG are generated randomly or based on a seed. If set to false, the IDs are generated based on the current date and thus are not -deterministic. This is the default behaviour. +deterministic. This is the default behavior. **Notes**: diff --git a/docs/c4c.md b/docs/c4c.md index 9d1f1ec6f..86c275a06 100644 --- a/docs/c4c.md +++ b/docs/c4c.md @@ -5,7 +5,7 @@ -Mermaid's c4 diagram sytax is compatible with plantUML. See example below: +Mermaid's c4 diagram syntax is compatible with plantUML. See example below: ```mermaid-example C4Context diff --git a/docs/gitgraph.md b/docs/gitgraph.md index 14833b6f6..2425d6fa2 100644 --- a/docs/gitgraph.md +++ b/docs/gitgraph.md @@ -194,7 +194,7 @@ Here, a new commit representing the cherry-pick is created on the current branch A few important rules to note here are: 1. You need to provide the `id` for an existing commit to be cherry-picked. If given commit id does not exist it will result in an error. For this, make use of the `commit id:$value` format of declaring commits. See the examples from above. 2. The given commit must not exist on the current branch. The cherry-picked commit must always be a different branch than the current branch. -3. Current branch must have at least one commit, before you can cherry-pick, otherwise it will case an error is throw. +3. Current branch must have at least one commit, before you can cherry-pick, otherwise it will cause an error is throw. Let see an example: ```mermaid-example diff --git a/docs/newDiagram.md b/docs/newDiagram.md index 01efdabe3..c3fcd18a3 100644 --- a/docs/newDiagram.md +++ b/docs/newDiagram.md @@ -110,7 +110,7 @@ Look at `graphDb.js` for more details on that object. ## Layout -If you are using a dagre based layout, please use flowchart-v2 as a template and by doing that you will be using dagre-wrapper instead of dagreD3 which we are m igrating away from. +If you are using a dagre based layout, please use flowchart-v2 as a template and by doing that you will be using dagre-wrapper instead of dagreD3 which we are migrating away from. ### Common parts of a diagram @@ -129,7 +129,7 @@ Here is example handling from flowcharts: Jison: ```jison -/* lexial grammar */ +/* lexical grammar */ %lex %x open_directive %x type_directive @@ -175,7 +175,7 @@ It is probably a good idea to keep the handling similar to this in your new diag The syntax for adding title and description looks like this: ``` accTitle: The title -accDescr: The dsscription +accDescr: The description accDescr { Syntax for a description text diff --git a/src/config.js b/src/config.js index 24fe5b4d0..f438318c7 100644 --- a/src/config.js +++ b/src/config.js @@ -21,7 +21,7 @@ export const updateCurrentConfig = (siteCfg, _directives) => { const d = _directives[i]; sanitize(d); - // Apply the data from the directive where the the overrides the themeVaraibles + // Apply the data from the directive where the the overrides the themeVariables sumOfDirectives = assignWithDepth(sumOfDirectives, d); } @@ -67,7 +67,7 @@ export const setSiteConfig = (conf) => { return siteConfig; }; -export const saveConfigFromInitilize = (conf) => { +export const saveConfigFromInitialize = (conf) => { configFromInitialize = assignWithDepth({}, conf); }; diff --git a/src/dagre-wrapper/GraphObjects.md b/src/dagre-wrapper/GraphObjects.md index 52c7cd27c..416dfeb73 100644 --- a/src/dagre-wrapper/GraphObjects.md +++ b/src/dagre-wrapper/GraphObjects.md @@ -23,7 +23,7 @@ flowchart The new nodes C1 and C2 are a special type of nodes, clusterNodes. ClusterNodes have have the nodes in the cluster including the cluster attached in a graph object. -When rendering this diagram it it beeing rendered recursivly. The diagram is rendered by the dagre-mermaid:render function which in turn will be used to render the node C1 and the node C2. The result of those renderings will be inserted as nodes in the "root" diagram. With this recursive approach it would be possible to have different layout direction for each cluster. +When rendering this diagram it it beeing rendered recursively. The diagram is rendered by the dagre-mermaid:render function which in turn will be used to render the node C1 and the node C2. The result of those renderings will be inserted as nodes in the "root" diagram. With this recursive approach it would be possible to have different layout direction for each cluster. ``` { clusterNode: true, graph } @@ -74,7 +74,7 @@ This is set by the renderer of the diagram and insert the data that the wrapper | property | description | | ---------- | ----------------------------------------------------------------------------------------------------------- | -| labelStyle | Css styles for the label. User for instance for stylling the labels for clusters | +| labelStyle | Css styles for the label. User for instance for styling the labels for clusters | | shape | The shape of the node. | | labelText | The text on the label | | rx | The corner radius - maybe part of the shape instead? Used for rects. | diff --git a/src/dagre-wrapper/clusters.js b/src/dagre-wrapper/clusters.js index 67e91daec..40729dead 100644 --- a/src/dagre-wrapper/clusters.js +++ b/src/dagre-wrapper/clusters.js @@ -78,7 +78,7 @@ const rect = (parent, node) => { }; /** - * Non visiable cluster where the note is group with its + * Non visible cluster where the note is group with its * * @param {any} parent * @param {any} node diff --git a/src/dagre-wrapper/edges.js b/src/dagre-wrapper/edges.js index dbee50b12..60ded826e 100644 --- a/src/dagre-wrapper/edges.js +++ b/src/dagre-wrapper/edges.js @@ -313,7 +313,7 @@ const cutPathAtIntersect = (_points, boundryNode) => { // check if point is inside the boundry rect if (!outsideNode(boundryNode, point) && !isInside) { // First point inside the rect found - // Calc the intersection coord between the point anf the last opint ouside the rect + // Calc the intersection coord between the point anf the last point outside the rect const inter = intersection(boundryNode, lastPointOutside, point); log.warn('abc88 inside', point, lastPointOutside, inter); log.warn('abc88 intersection', inter); @@ -391,7 +391,7 @@ export const insertEdge = function (elem, e, edge, clusterDb, diagramType, graph // } // isInside = true; // } else { - // // outtside + // // outside // lastPointOutside = point; // if (!isInside) points.push(point); // } diff --git a/src/dagre-wrapper/edges.spec.js b/src/dagre-wrapper/edges.spec.js index f087812f8..627691a8e 100644 --- a/src/dagre-wrapper/edges.spec.js +++ b/src/dagre-wrapper/edges.spec.js @@ -30,7 +30,7 @@ describe('Graphlib decorations', () => { expect(int.x).toBeCloseTo(192.4609375); expect(int.y).toBeCloseTo(145.15711441743503); }); - it('case 3 - intersection on otop of box outside point greater then inside point', function () { + it('case 3 - intersection on top of box outside point greater then inside point', function () { const o = { x: 157, y: 39 }; const i = { x: 104, y: 105 }; const node2 = { diff --git a/src/dagre-wrapper/index.js b/src/dagre-wrapper/index.js index ca9f0945c..daf130f0d 100644 --- a/src/dagre-wrapper/index.js +++ b/src/dagre-wrapper/index.js @@ -61,7 +61,7 @@ const recursiveRender = (_elem, graph, diagramtype, parentCluster) => { log.warn('Recursive render complete ', newEl, node); } else { if (graph.children(v).length > 0) { - // This is a cluster but not to be rendered recusively + // This is a cluster but not to be rendered recursively // Render as before log.info('Cluster - the non recursive path XXX', v, node.id, node, graph); log.info(findNonClusterChild(node.id, graph)); @@ -117,7 +117,7 @@ const recursiveRender = (_elem, graph, diagramtype, parentCluster) => { } else { // Non cluster node if (graph.children(v).length > 0) { - // A cluster in the non-recurive way + // A cluster in the non-recursive way // positionCluster(node); insertCluster(clusters, node); clusterDb[node.id].node = node; diff --git a/src/dagre-wrapper/markers.js b/src/dagre-wrapper/markers.js index e383feb5e..ca2a12200 100644 --- a/src/dagre-wrapper/markers.js +++ b/src/dagre-wrapper/markers.js @@ -244,7 +244,7 @@ const barb = (elem, type) => { .attr('d', 'M 19,7 L9,13 L14,7 L9,1 Z'); }; -// TODO rename the class diagram markers to something shape descriptive and semanitc free +// TODO rename the class diagram markers to something shape descriptive and semantic free const markers = { extension, composition, diff --git a/src/dagre-wrapper/mermaid-graphlib.js b/src/dagre-wrapper/mermaid-graphlib.js index 0479ee640..aa7414ff7 100644 --- a/src/dagre-wrapper/mermaid-graphlib.js +++ b/src/dagre-wrapper/mermaid-graphlib.js @@ -210,7 +210,7 @@ export const adjustClustersAndEdges = (graph, depth) => { } else { log.debug('Opting in, graph '); } - // Go through the nodes and for each cluster found, save a replacment node, this can be used when + // Go through the nodes and for each cluster found, save a replacement node, this can be used when // faking a link to a cluster graph.nodes().forEach(function (id) { const children = graph.children(id); @@ -257,7 +257,7 @@ export const adjustClustersAndEdges = (graph, depth) => { }); // For clusters with incoming and/or outgoing edges translate those edges to a real node - // in the cluster inorder to fake the edge + // in the cluster in order to fake the edge graph.edges().forEach(function (e) { const edge = graph.edge(e); log.warn('Edge ' + e.v + ' -> ' + e.w + ': ' + JSON.stringify(e)); diff --git a/src/dagre-wrapper/nodes.js b/src/dagre-wrapper/nodes.js index d949ec88e..5f608b949 100644 --- a/src/dagre-wrapper/nodes.js +++ b/src/dagre-wrapper/nodes.js @@ -877,7 +877,7 @@ const class_box = (parent, node) => { ); verticalPos = interfaceBBox.height + rowPadding; } - // Positin the class title label + // Position the class title label let diffX = (maxWidth - classTitleBBox.width) / 2; select(classTitleLabel).attr( 'transform', diff --git a/src/dagre-wrapper/patterns.js b/src/dagre-wrapper/patterns.js index 3f007b0ee..75afa8bcc 100644 --- a/src/dagre-wrapper/patterns.js +++ b/src/dagre-wrapper/patterns.js @@ -45,7 +45,7 @@ const dots = (elem, type) => { .attr('d', 'M 19,7 L9,13 L14,7 L9,1 Z'); }; -// TODO rename the class diagram markers to something shape descriptive and semanitc free +// TODO rename the class diagram markers to something shape descriptive and semantic free const patterns = { dots, }; diff --git a/src/diagrams/c4/c4Renderer.js b/src/diagrams/c4/c4Renderer.js index d71e70e2e..e238aa817 100644 --- a/src/diagrams/c4/c4Renderer.js +++ b/src/diagrams/c4/c4Renderer.js @@ -568,7 +568,7 @@ function drawInsideBoundary(diagram, parentBoundaryAlias, parentBounds, currentB export const draw = function (text, id) { conf = configApi.getConfig().c4; const securityLevel = configApi.getConfig().securityLevel; - // Handle root and ocument for when rendering in sanbox mode + // Handle root and Document for when rendering in sanbox mode let sandboxElement; if (securityLevel === 'sandbox') { sandboxElement = select('#i' + id); diff --git a/src/diagrams/c4/svgDraw.js b/src/diagrams/c4/svgDraw.js index fb3a276db..8882ae78d 100644 --- a/src/diagrams/c4/svgDraw.js +++ b/src/diagrams/c4/svgDraw.js @@ -315,7 +315,7 @@ const drawBoundary = function (elem, boundary, conf) { drawRect(boundaryElem, rectData); - // draw lable + // draw label let boundaryConf = conf.boundaryFont(); boundaryConf.fontWeight = 'bold'; boundaryConf.fontSize = boundaryConf.fontSize + 2; diff --git a/src/diagrams/class/classRenderer-v2.js b/src/diagrams/class/classRenderer-v2.js index 509c2198a..e892134f4 100644 --- a/src/diagrams/class/classRenderer-v2.js +++ b/src/diagrams/class/classRenderer-v2.js @@ -138,7 +138,7 @@ export const addClasses = function (classes, g) { }; /** - * Add edges to graph based on parsed graph defninition + * Add edges to graph based on parsed graph definition * * @param relations * @param {object} g The graph object @@ -317,7 +317,7 @@ export const draw = function (text, id) { // flowDb.addVertex(subG.id, subG.title, 'group', undefined, subG.classes); // } - // Fetch the verices/nodes and edges/links from the parsed graph definition + // Fetch the vertices/nodes and edges/links from the parsed graph definition const classes = classDb.getClasses(); const relations = classDb.getRelations(); diff --git a/src/diagrams/class/classRenderer.js b/src/diagrams/class/classRenderer.js index e9ff20df8..83f5aa8f2 100644 --- a/src/diagrams/class/classRenderer.js +++ b/src/diagrams/class/classRenderer.js @@ -168,7 +168,7 @@ export const draw = function (text, id) { log.info('Rendering diagram ' + text); const securityLevel = getConfig().securityLevel; - // Handle root and ocument for when rendering in sanbox mode + // Handle root and Document for when rendering in sanbox mode let sandboxElement; if (securityLevel === 'sandbox') { sandboxElement = select('#i' + id); diff --git a/src/diagrams/er/erRenderer.js b/src/diagrams/er/erRenderer.js index a8589da72..e43b75ac0 100644 --- a/src/diagrams/er/erRenderer.js +++ b/src/diagrams/er/erRenderer.js @@ -547,7 +547,7 @@ export const draw = function (text, id) { const parser = erParser.parser; parser.yy = erDb; const securityLevel = getConfig().securityLevel; - // Handle root and ocument for when rendering in sanbox mode + // Handle root and Document for when rendering in sanbox mode let sandboxElement; if (securityLevel === 'sandbox') { sandboxElement = select('#i' + id); @@ -575,7 +575,7 @@ export const draw = function (text, id) { // --- // 1. Create all the entities in the svg node at 0,0, but with the correct dimensions (allowing for text content) // 2. Make sure they are all added to the graph - // 3. Add all the edges (relationships) to the graph aswell + // 3. Add all the edges (relationships) to the graph as well // 4. Let dagre do its magic to layout the graph. This assigns: // - the centre co-ordinates for each node, bearing in mind the dimensions and edge relationships // - the path co-ordinates for each edge diff --git a/src/diagrams/flowchart/flowDb.js b/src/diagrams/flowchart/flowDb.js index 00dc61913..5cdec50bf 100644 --- a/src/diagrams/flowchart/flowDb.js +++ b/src/diagrams/flowchart/flowDb.js @@ -465,7 +465,7 @@ export const addSubGraph = function (_id, list, _title) { const prims = { boolean: {}, number: {}, string: {} }; const objs = []; - let dir; // = unbdefined; direction.trim(); + let dir; // = undefined; direction.trim(); const nodeList = a.filter(function (item) { const type = typeof item; if (item.stmt && item.stmt === 'dir') { diff --git a/src/diagrams/flowchart/parser/flow-comments.spec.js b/src/diagrams/flowchart/parser/flow-comments.spec.js index 861d39236..7aeed304c 100644 --- a/src/diagrams/flowchart/parser/flow-comments.spec.js +++ b/src/diagrams/flowchart/parser/flow-comments.spec.js @@ -58,7 +58,7 @@ describe('[Comments] when parsing', () => { }); it('should handle comments at the end no trailing newline', function () { - const res = flow.parser.parse('graph TD;\n A-->B\n%% Commento'); + const res = flow.parser.parse('graph TD;\n A-->B\n%% Comment'); const vert = flow.parser.yy.getVertices(); const edges = flow.parser.yy.getEdges(); @@ -73,7 +73,7 @@ describe('[Comments] when parsing', () => { }); it('should handle comments at the end many trailing newlines', function () { - const res = flow.parser.parse('graph TD;\n A-->B\n%% Commento\n\n\n'); + const res = flow.parser.parse('graph TD;\n A-->B\n%% Comment\n\n\n'); const vert = flow.parser.yy.getVertices(); const edges = flow.parser.yy.getEdges(); diff --git a/src/diagrams/flowchart/parser/flow.spec.js b/src/diagrams/flowchart/parser/flow.spec.js index b2b01f84f..6b440da79 100644 --- a/src/diagrams/flowchart/parser/flow.spec.js +++ b/src/diagrams/flowchart/parser/flow.spec.js @@ -12,7 +12,7 @@ describe('parsing a flow chart', function () { flow.parser.yy.clear(); }); - it('should handle a trailing whitespaces after statememnts', function () { + it('should handle a trailing whitespaces after statements', function () { const res = flow.parser.parse('graph TD;\n\n\n %% Comment\n A-->B; \n B-->C;'); const vert = flow.parser.yy.getVertices(); diff --git a/src/diagrams/gantt/ganttRenderer.js b/src/diagrams/gantt/ganttRenderer.js index 2cf46eae5..0065f14d9 100644 --- a/src/diagrams/gantt/ganttRenderer.js +++ b/src/diagrams/gantt/ganttRenderer.js @@ -30,7 +30,7 @@ export const draw = function (text, id) { parser.parse(text); const securityLevel = getConfig().securityLevel; - // Handle root and ocument for when rendering in sanbox mode + // Handle root and Document for when rendering in sanbox mode let sandboxElement; if (securityLevel === 'sandbox') { sandboxElement = select('#i' + id); diff --git a/src/diagrams/git/gitGraphRenderer.js b/src/diagrams/git/gitGraphRenderer.js index 2735ea83d..6ee9f1855 100644 --- a/src/diagrams/git/gitGraphRenderer.js +++ b/src/diagrams/git/gitGraphRenderer.js @@ -65,9 +65,9 @@ const drawText = (txt) => { }; /** - * Draws the commits with its symbol and labels. The function has tywo modes, one which only + * Draws the commits with its symbol and labels. The function has two modes, one which only * calculates the positions and one that does the actual drawing. This for a simple way getting the - * vertical leyering rcorrect in the graph. + * vertical layering correct in the graph. * * @param {any} svg * @param {any} commits @@ -345,7 +345,7 @@ const findLane = (y1, y2, _depth) => { }; /** - * This function draw trhe lines between the commits. They were arrows initially. + * This function draw the lines between the commits. They were arrows initially. * * @param {any} svg * @param {any} commit1 diff --git a/src/diagrams/info/infoRenderer.js b/src/diagrams/info/infoRenderer.js index b01931a22..7b8f68251 100644 --- a/src/diagrams/info/infoRenderer.js +++ b/src/diagrams/info/infoRenderer.js @@ -28,7 +28,7 @@ export const draw = (text, id, version) => { log.debug('Renering info diagram\n' + text); const securityLevel = getConfig().securityLevel; - // Handle root and ocument for when rendering in sanbox mode + // Handle root and Document for when rendering in sanbox mode let sandboxElement; if (securityLevel === 'sandbox') { sandboxElement = select('#i' + id); diff --git a/src/diagrams/pie/pieRenderer.js b/src/diagrams/pie/pieRenderer.js index 0c3df7220..b44dc97be 100644 --- a/src/diagrams/pie/pieRenderer.js +++ b/src/diagrams/pie/pieRenderer.js @@ -25,7 +25,7 @@ export const draw = (txt, id) => { log.debug('Rendering info diagram\n' + txt); const securityLevel = configApi.getConfig().securityLevel; - // Handle root and ocument for when rendering in sanbox mode + // Handle root and Document for when rendering in sanbox mode let sandboxElement; if (securityLevel === 'sandbox') { sandboxElement = select('#i' + id); diff --git a/src/diagrams/requirement/requirementRenderer.js b/src/diagrams/requirement/requirementRenderer.js index ee2656529..f69805f03 100644 --- a/src/diagrams/requirement/requirementRenderer.js +++ b/src/diagrams/requirement/requirementRenderer.js @@ -324,7 +324,7 @@ export const draw = (text, id) => { parser.parse(text); const securityLevel = getConfig().securityLevel; - // Handle root and ocument for when rendering in sanbox mode + // Handle root and Document for when rendering in sanbox mode let sandboxElement; if (securityLevel === 'sandbox') { sandboxElement = select('#i' + id); diff --git a/src/diagrams/sequence/sequenceRenderer.js b/src/diagrams/sequence/sequenceRenderer.js index caa285a8a..d83d9dc2b 100644 --- a/src/diagrams/sequence/sequenceRenderer.js +++ b/src/diagrams/sequence/sequenceRenderer.js @@ -587,7 +587,7 @@ function adjustLoopHeightForWrap(loopWidths, msg, preMargin, postMargin, addLoop export const draw = function (text, id) { conf = configApi.getConfig().sequence; const securityLevel = configApi.getConfig().securityLevel; - // Handle root and ocument for when rendering in sanbox mode + // Handle root and Document for when rendering in sanbox mode let sandboxElement; if (securityLevel === 'sandbox') { sandboxElement = select('#i' + id); diff --git a/src/diagrams/state/shapes.js b/src/diagrams/state/shapes.js index 2a25e0005..c3826856e 100644 --- a/src/diagrams/state/shapes.js +++ b/src/diagrams/state/shapes.js @@ -362,7 +362,7 @@ export const drawNote = (text, g) => { /** * Starting point for drawing a state. The function finds out the specifics about the state and - * renders with approprtiate function. + * renders with appropriate function. * * @param {any} elem * @param {any} stateDef diff --git a/src/diagrams/state/stateDiagram-v2.spec.js b/src/diagrams/state/stateDiagram-v2.spec.js index 701fec62b..ad224f14d 100644 --- a/src/diagrams/state/stateDiagram-v2.spec.js +++ b/src/diagrams/state/stateDiagram-v2.spec.js @@ -107,8 +107,8 @@ describe('state diagram, ', function () { }); it('handle "as" in state names 2', function () { const str = `stateDiagram-v2 - assembleas - state assembleas + assemblies + state assemblies `; parser.parse(str); @@ -207,14 +207,14 @@ describe('state diagram, ', function () { parser.parse(str); }); - it('should handle state deifintions with separation of id', function () { + it('should handle state definitions with separation of id', function () { const str = `stateDiagram-v2\n state "Long state description" as state1 `; parser.parse(str); }); - it('should handle state deifintions with separation of id', function () { + it('should handle state definitions with separation of id', function () { const str = `stateDiagram-v2 state "Not Shooting State" as NotShooting { state "Idle mode" as Idle diff --git a/src/diagrams/state/stateDiagram.spec.js b/src/diagrams/state/stateDiagram.spec.js index 0b2b30a1e..144dd16e5 100644 --- a/src/diagrams/state/stateDiagram.spec.js +++ b/src/diagrams/state/stateDiagram.spec.js @@ -122,8 +122,8 @@ describe('state diagram, ', function () { }); it('handle "as" in state names 2', function () { const str = `stateDiagram - assembleas - state assembleas + assemblies + state assemblies `; parser.parse(str); @@ -222,14 +222,14 @@ describe('state diagram, ', function () { parser.parse(str); }); - it('should handle state deifintions with separation of id', function () { + it('should handle state defintions with separation of id', function () { const str = `stateDiagram\n state "Long state description" as state1 `; parser.parse(str); }); - it('should handle state deifintions with separation of id', function () { + it('should handle state defintions with separation of id', function () { const str = `stateDiagram state "Not Shooting State" as NotShooting { state "Idle mode" as Idle diff --git a/src/diagrams/state/stateRenderer.js b/src/diagrams/state/stateRenderer.js index 536a7672f..89af9386c 100644 --- a/src/diagrams/state/stateRenderer.js +++ b/src/diagrams/state/stateRenderer.js @@ -48,7 +48,7 @@ const insertMarkers = function (elem) { export const draw = function (text, id) { conf = getConfig().state; const securityLevel = getConfig().securityLevel; - // Handle root and ocument for when rendering in sanbox mode + // Handle root and Document for when rendering in sanbox mode let sandboxElement; if (securityLevel === 'sandbox') { sandboxElement = select('#i' + id); diff --git a/src/diagrams/user-journey/journeyRenderer.js b/src/diagrams/user-journey/journeyRenderer.js index 24ab8cb8a..5fcaec020 100644 --- a/src/diagrams/user-journey/journeyRenderer.js +++ b/src/diagrams/user-journey/journeyRenderer.js @@ -56,7 +56,7 @@ export const draw = function (text, id) { parser.parse(text + '\n'); const securityLevel = getConfig().securityLevel; - // Handle root and ocument for when rendering in sanbox mode + // Handle root and Document for when rendering in sanbox mode let sandboxElement; if (securityLevel === 'sandbox') { sandboxElement = select('#i' + id); diff --git a/src/mermaid.js b/src/mermaid.js index 5181eb557..3ea510a7f 100644 --- a/src/mermaid.js +++ b/src/mermaid.js @@ -90,7 +90,7 @@ const initThrowsErrors = function () { mermaidAPI.updateSiteConfig({ gantt: mermaid.ganttConfig }); } - const idGeneratior = new utils.initIdGeneratior(conf.deterministicIds, conf.deterministicIDSeed); + const idGenerator = new utils.initIdGenerator(conf.deterministicIds, conf.deterministicIDSeed); let txt; @@ -105,7 +105,7 @@ const initThrowsErrors = function () { continue; } - const id = `mermaid-${idGeneratior.next()}`; + const id = `mermaid-${idGenerator.next()}`; // Fetch the graph definition including tags txt = element.innerHTML; @@ -189,7 +189,7 @@ if (typeof document !== 'undefined') { } /** - * ## setParseErrorHandler Alternativet to directly setting parseError using: + * ## setParseErrorHandler Alternative to directly setting parseError using: * * ```js * mermaid.parseError = function(err,hash){= diff --git a/src/mermaidAPI.js b/src/mermaidAPI.js index 750c73cb1..8d48f6487 100644 --- a/src/mermaidAPI.js +++ b/src/mermaidAPI.js @@ -272,7 +272,7 @@ const render = function (id, _txt, cb, container) { // let d3Iframe; let root = select('body'); - // In regular execurtion the container will be the div with a mermaid class + // In regular execution the container will be the div with a mermaid class if (typeof container !== 'undefined') { if (cnf.securityLevel === 'sandbox') { // IF we are in sandboxed mode, we do everyting mermaid related @@ -317,7 +317,7 @@ const render = function (id, _txt, cb, container) { } else { // No container was provided // If there is an existsing element with the id, we remove it - // this likley a previously rendered diagram + // this likely a previously rendered diagram const existingSvg = document.getElementById(id); if (existingSvg) { existingSvg.remove(); @@ -743,7 +743,7 @@ function initialize(options) { } } // Set default options - configApi.saveConfigFromInitilize(options); + configApi.saveConfigFromInitialize(options); if (options && options.theme && theme[options.theme]) { // Todo merge with user options diff --git a/src/themes/theme-base.js b/src/themes/theme-base.js index 551103ee3..fcac86dd5 100644 --- a/src/themes/theme-base.js +++ b/src/themes/theme-base.js @@ -5,7 +5,7 @@ class Theme { /** # Base variables */ /** * - Background - used to know what the background color is of the diagram. This is used for - * deducing colors for istance line color. Defaulr value is #f4f4f4. + * deducing colors for instance line color. Default value is #f4f4f4. */ this.background = '#f4f4f4'; this.darkMode = false; @@ -21,7 +21,7 @@ class Theme { this.fontSize = '16px'; } updateColors() { - // The || is to make sure that if the variable has been defiend by a user override that value is to be used + // The || is to make sure that if the variable has been defined by a user override that value is to be used /* Main */ this.primaryTextColor = this.primaryTextColor || (this.darkMode ? '#eee' : '#333'); // invert(this.primaryColor); @@ -103,7 +103,7 @@ class Theme { /* state colors */ this.transitionColor = this.transitionColor || this.lineColor; this.transitionLabelColor = this.transitionLabelColor || this.textColor; - /* The color of the text tables of the tstates*/ + /* The color of the text tables of the states*/ this.stateLabelColor = this.stateLabelColor || this.stateBkg || this.primaryTextColor; this.stateBkg = this.stateBkg || this.mainBkg; diff --git a/src/utils.js b/src/utils.js index be28ef8df..0d2b4392c 100644 --- a/src/utils.js +++ b/src/utils.js @@ -945,7 +945,7 @@ export const setupGraphViewbox = function (graph, svgElem, padding, useMaxWidth) // Ensure the viewBox includes the whole svgBounds area with extra space for padding const vBox = `0 0 ${width} ${height}`; log.debug( - 'Grpah.label', + 'Graph.label', graph._label, 'swidth', sWidth, @@ -966,7 +966,7 @@ export const setupGraphViewbox = function (graph, svgElem, padding, useMaxWidth) svgElem.select('g').attr('transform', `translate(${tx}, ${ty})`); }; -export const initIdGeneratior = class iterator { +export const initIdGenerator = class iterator { constructor(deterministic, seed) { this.deterministic = deterministic; this.seed = seed; @@ -1109,7 +1109,7 @@ export default { memoize, runFunc, entityDecode, - initIdGeneratior, + initIdGenerator: initIdGenerator, directiveSanitizer, sanitizeCss, }; diff --git a/src/utils.spec.js b/src/utils.spec.js index 2e8d335d0..b079beeeb 100644 --- a/src/utils.spec.js +++ b/src/utils.spec.js @@ -302,7 +302,7 @@ describe('when calculating SVG size', function () { describe('when initializing the id generator', function () { it('should return a random number generator based on Date', function (done) { - const idGenerator = new utils.initIdGeneratior(false); + const idGenerator = new utils.initIdGenerator(false); expect(typeof idGenerator.next).toEqual('function'); const lastId = idGenerator.next(); setTimeout(() => { @@ -312,7 +312,7 @@ describe('when initializing the id generator', function () { }); it('should return a non random number generator', function () { - const idGenerator = new utils.initIdGeneratior(true); + const idGenerator = new utils.initIdGenerator(true); expect(typeof idGenerator.next).toEqual('function'); const start = 0; const lastId = idGenerator.next(); @@ -321,7 +321,7 @@ describe('when initializing the id generator', function () { }); it('should return a non random number generator based on seed', function () { - const idGenerator = new utils.initIdGeneratior(true, 'thisIsASeed'); + const idGenerator = new utils.initIdGenerator(true, 'thisIsASeed'); expect(typeof idGenerator.next).toEqual('function'); const start = 11; const lastId = idGenerator.next();