fix(flow): fix invalid ellipseText regex
This invalid regex was causing Mermaid to freeze.
This commit is contained in:
parent
29942c04dc
commit
172d90e731
|
@ -535,6 +535,10 @@ describe('[Text] when parsing', () => {
|
|||
expect(vert['A'].text).toBe('this is an ellipse');
|
||||
});
|
||||
|
||||
it('should not freeze when ellipse text has a `(`', function () {
|
||||
expect(() => flow.parser.parse('graph\nX(- My Text (')).toThrowError();
|
||||
});
|
||||
|
||||
it('should handle text in diamond vertices with space', function () {
|
||||
const res = flow.parser.parse('graph TD;A(chimpansen hoppar)-->C;');
|
||||
|
||||
|
|
|
@ -134,7 +134,7 @@ that id.
|
|||
<*>\s*\~\~[\~]+\s* return 'LINK';
|
||||
|
||||
<ellipseText>[-/\)][\)] { this.popState(); return '-)'; }
|
||||
<ellipseText>[^\(\)\[\]\{\}]|-/!\)+ return "TEXT"
|
||||
<ellipseText>[^\(\)\[\]\{\}]|-\!\)+ return "TEXT"
|
||||
<*>"(-" { this.pushState("ellipseText"); return '(-'; }
|
||||
|
||||
<text>"])" { this.popState(); return 'STADIUMEND'; }
|
||||
|
|
Loading…
Reference in New Issue