mirror of
https://github.com/mermaid-js/mermaid.git
synced 2025-01-14 06:43:25 +08:00
#4012 Allowing multiple lines before the mindmap statement
This commit is contained in:
parent
3cd15cdcf2
commit
80903e427c
@ -354,6 +354,18 @@ root
|
||||
expect(mm.nodeId).toEqual('root');
|
||||
expect(mm.children.length).toEqual(2);
|
||||
|
||||
const child = mm.children[0];
|
||||
expect(child.nodeId).toEqual('A');
|
||||
const child2 = mm.children[1];
|
||||
expect(child2.nodeId).toEqual('B');
|
||||
});
|
||||
it('MMP-24 Handle rows above the mindmap declarations', function () {
|
||||
let str = '\n \nmindmap\nroot\n A\n \n\n B';
|
||||
mindmap.parse(str);
|
||||
const mm = mindmap.yy.getMindmap();
|
||||
expect(mm.nodeId).toEqual('root');
|
||||
expect(mm.children.length).toEqual(2);
|
||||
|
||||
const child = mm.children[0];
|
||||
expect(child.nodeId).toEqual('A');
|
||||
const child2 = mm.children[1];
|
||||
|
@ -67,9 +67,16 @@ start
|
||||
// %{ : info document 'EOF' { return yy; } }
|
||||
: MINDMAP document { return yy; }
|
||||
| MINDMAP NL document { return yy; }
|
||||
| SPACELIST MINDMAP document { return yy; }
|
||||
| spaceLines MINDMAP document { return yy; }
|
||||
| spaceLines MINDMAP NL document { return yy; }
|
||||
;
|
||||
|
||||
spaceLines
|
||||
: SPACELINE
|
||||
| spaceLines SPACELINE
|
||||
| spaceLines NL
|
||||
;
|
||||
|
||||
stop
|
||||
: NL {yy.getLogger().trace('Stop NL ');}
|
||||
| EOF {yy.getLogger().trace('Stop EOF ');}
|
||||
|
Loading…
x
Reference in New Issue
Block a user