mirror of
https://github.com/mermaid-js/mermaid.git
synced 2025-09-25 18:30:10 +02:00
Making it possible to have style/% in class definitions as described in issue #54
This commit is contained in:
@@ -341,7 +341,7 @@ style: styleComponent
|
||||
{$$ = $1 + $2;}
|
||||
;
|
||||
|
||||
styleComponent: ALPHA | COLON | MINUS | NUM | UNIT | SPACE | HEX | BRKT | DOT;
|
||||
styleComponent: ALPHA | COLON | MINUS | NUM | UNIT | SPACE | HEX | BRKT | DOT | STYLE | PCT ;
|
||||
|
||||
/* Token lists */
|
||||
|
||||
|
File diff suppressed because one or more lines are too long
@@ -288,6 +288,26 @@ describe('when parsing ',function(){
|
||||
expect(edges[0].type).toBe('arrow');
|
||||
});
|
||||
|
||||
it('should handle classDefs with style in classes',function(){
|
||||
var res = flow.parser.parse('graph TD\nA-->B\nclassDef exClass font-style:bold;');
|
||||
|
||||
var vert = flow.parser.yy.getVertices();
|
||||
var edges = flow.parser.yy.getEdges();
|
||||
|
||||
|
||||
expect(edges[0].type).toBe('arrow');
|
||||
});
|
||||
|
||||
it('should handle classDefs with % in classes',function(){
|
||||
var res = flow.parser.parse('graph TD\nA-->B\nclassDef exClass fill:#f96,stroke:#333,stroke-width:4px,font-size:50%,font-style:bold;');
|
||||
|
||||
var vert = flow.parser.yy.getVertices();
|
||||
var edges = flow.parser.yy.getEdges();
|
||||
|
||||
|
||||
expect(edges[0].type).toBe('arrow');
|
||||
});
|
||||
|
||||
describe("it should handle text on edges",function(){
|
||||
it('it should handle text without space',function(){
|
||||
var res = flow.parser.parse('graph TD;A--x|textNoSpace|B;');
|
||||
|
Reference in New Issue
Block a user