mirror of
https://github.com/mermaid-js/mermaid.git
synced 2025-09-18 23:09:49 +02:00
Merge pull request #5016 from aloisklink/fix/4964-fix-invalid-ellipseText-regex
fix(flow): fix invalid ellipseText regex
This commit is contained in:
@@ -535,6 +535,10 @@ describe('[Text] when parsing', () => {
|
|||||||
expect(vert['A'].text).toBe('this is an ellipse');
|
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 () {
|
it('should handle text in diamond vertices with space', function () {
|
||||||
const res = flow.parser.parse('graph TD;A(chimpansen hoppar)-->C;');
|
const res = flow.parser.parse('graph TD;A(chimpansen hoppar)-->C;');
|
||||||
|
|
||||||
|
@@ -134,7 +134,7 @@ that id.
|
|||||||
<*>\s*\~\~[\~]+\s* return 'LINK';
|
<*>\s*\~\~[\~]+\s* return 'LINK';
|
||||||
|
|
||||||
<ellipseText>[-/\)][\)] { this.popState(); return '-)'; }
|
<ellipseText>[-/\)][\)] { this.popState(); return '-)'; }
|
||||||
<ellipseText>[^\(\)\[\]\{\}]|-/!\)+ return "TEXT"
|
<ellipseText>[^\(\)\[\]\{\}]|-\!\)+ return "TEXT"
|
||||||
<*>"(-" { this.pushState("ellipseText"); return '(-'; }
|
<*>"(-" { this.pushState("ellipseText"); return '(-'; }
|
||||||
|
|
||||||
<text>"])" { this.popState(); return 'STADIUMEND'; }
|
<text>"])" { this.popState(); return 'STADIUMEND'; }
|
||||||
|
Reference in New Issue
Block a user