diff --git a/cypress/platform/knsv.html b/cypress/platform/knsv.html index 2d49d2fee..5ed1ac576 100644 --- a/cypress/platform/knsv.html +++ b/cypress/platform/knsv.html @@ -33,7 +33,6 @@ display: none; } .mermaid { - } .mermaid svg { border: 1px solid purple; @@ -45,8 +44,8 @@
 mindmap
-apa
-      bapa
+[apa]
+      ))bapa((
     
 flowchart TD
@@ -62,21 +61,14 @@ flowchart TD
     end
     end
 
-
-
-flowchart TD -id -
-
+    
+ +
 flowchart LR
         a["Haiya"]===>b
-
-
-flowchart TD - A --> B - A --> C - B --> C -
+ +
flowchart TD A --> B A --> C B --> C
 flowchart TD
       A([stadium shape test])
@@ -90,17 +82,12 @@ flowchart TD
       classDef someclass fill:#f96;
       class A someclass;
       class C someclass;
-
-
- sequenceDiagram - title: My Sequence Diagram Title - accTitle: My Acc Sequence Diagram - accDescr: My Sequence Diagram Description - - Alice->>John: Hello John, how are you? - John-->>Alice: Great! - Alice-)John: See you later!
+
+ sequenceDiagram title: My Sequence Diagram Title accTitle: My Acc Sequence Diagram accDescr: + My Sequence Diagram Description Alice->>John: Hello John, how are you? John-->>Alice: Great! + Alice-)John: See you later! +
 graph TD
     A -->|000| B
diff --git a/src/diagrams/mindmap/mindmap.spec.js b/src/diagrams/mindmap/mindmap.spec.js
index b06c4674b..f4397edb2 100644
--- a/src/diagrams/mindmap/mindmap.spec.js
+++ b/src/diagrams/mindmap/mindmap.spec.js
@@ -30,7 +30,17 @@ describe('when parsing a mindmap ', function () {
       expect(mm.children[0].descr).toEqual('child1');
       expect(mm.children[1].descr).toEqual('child2');
     });
-    it('should handle a hierachial mindmap definition', function () {
+
+    it('should handle a simple root definition with a shape and without an id abc123', function () {
+      var str = `mindmap
+    (root)`;
+
+      mindmap.parse(str);
+      // console.log('Time for checks', mindmap.yy.getMindmap().descr);
+      expect(mindmap.yy.getMindmap().descr).toEqual('root');
+    });
+
+    it('should handle a deeper hierachial mindmap definition', function () {
       var str = `mindmap
     root
       child1
@@ -131,7 +141,7 @@ root
 
     it('mutiple types (cloud)', function () {
       var str = `mindmap
- root))the root((
+ root)the root(
 `;
 
       mindmap.parse(str);
@@ -256,7 +266,7 @@ root
       expect(child.children[1].nodeId).toEqual('b');
     });
   });
-  it('should be possible to have meaningless empty rows in a mindmap abc123', function () {
+  it('should be possible to have meaningless empty rows in a mindmap abc124', function () {
     var str = `mindmap
   root(Root)
     Child(Child)
diff --git a/src/diagrams/mindmap/parser/mindmap.jison b/src/diagrams/mindmap/parser/mindmap.jison
index 52ec1ab11..d84c09495 100644
--- a/src/diagrams/mindmap/parser/mindmap.jison
+++ b/src/diagrams/mindmap/parser/mindmap.jison
@@ -86,6 +86,16 @@ statement
 	| EOF
 	;
 node
+  :nodeWithId
+  |nodeWithoutId
+  ;
+
+nodeWithoutId
+  :   NODE_DSTART NODE_DESCR NODE_DEND
+	      { console.log("node found ..", $1); $$ = { id: $2, descr: $2, type: yy.getType($1, $3) }; }
+  ;
+
+nodeWithId
 	:  NODE_ID             { $$ = { id: $1, descr: $1, type: yy.nodeType.DEFAULT }; }
 	|  NODE_ID NODE_DSTART NODE_DESCR NODE_DEND
 	                       { console.log("node found ..", $1); $$ = { id: $1, descr: $3, type: yy.getType($2, $4) }; }