mirror of
https://github.com/mermaid-js/mermaid.git
synced 2025-10-18 13:39:41 +02:00
Compare commits
3 Commits
7079-c4con
...
renovate/p
Author | SHA1 | Date | |
---|---|---|---|
![]() |
322bb94c85 | ||
![]() |
3d768f3adf | ||
![]() |
ac411a7d7e |
@@ -1,5 +0,0 @@
|
|||||||
---
|
|
||||||
'mermaid': patch
|
|
||||||
---
|
|
||||||
|
|
||||||
fix: Support ComponentQueue_Ext to prevent parsing error
|
|
2
.github/workflows/e2e-timings.yml
vendored
2
.github/workflows/e2e-timings.yml
vendored
@@ -58,7 +58,7 @@ jobs:
|
|||||||
echo "EOF" >> $GITHUB_OUTPUT
|
echo "EOF" >> $GITHUB_OUTPUT
|
||||||
|
|
||||||
- name: Commit and create pull request
|
- name: Commit and create pull request
|
||||||
uses: peter-evans/create-pull-request@915d841dae6a4f191bb78faf61a257411d7be4d2
|
uses: peter-evans/create-pull-request@46cdba753c74545733b821043d64bd6925fc4da9
|
||||||
with:
|
with:
|
||||||
add-paths: |
|
add-paths: |
|
||||||
cypress/timings.json
|
cypress/timings.json
|
||||||
|
@@ -21,7 +21,7 @@ title: Animal example
|
|||||||
classDiagram
|
classDiagram
|
||||||
note "From Duck till Zebra"
|
note "From Duck till Zebra"
|
||||||
Animal <|-- Duck
|
Animal <|-- Duck
|
||||||
note for Duck "can fly\ncan swim\ncan dive\ncan help in debugging"
|
note for Duck "can fly<br>can swim<br>can dive<br>can help in debugging"
|
||||||
Animal <|-- Fish
|
Animal <|-- Fish
|
||||||
Animal <|-- Zebra
|
Animal <|-- Zebra
|
||||||
Animal : +int age
|
Animal : +int age
|
||||||
@@ -50,7 +50,7 @@ title: Animal example
|
|||||||
classDiagram
|
classDiagram
|
||||||
note "From Duck till Zebra"
|
note "From Duck till Zebra"
|
||||||
Animal <|-- Duck
|
Animal <|-- Duck
|
||||||
note for Duck "can fly\ncan swim\ncan dive\ncan help in debugging"
|
note for Duck "can fly<br>can swim<br>can dive<br>can help in debugging"
|
||||||
Animal <|-- Fish
|
Animal <|-- Fish
|
||||||
Animal <|-- Zebra
|
Animal <|-- Zebra
|
||||||
Animal : +int age
|
Animal : +int age
|
||||||
|
@@ -1,58 +0,0 @@
|
|||||||
import c4Db from '../c4Db.js';
|
|
||||||
import c4 from './c4Diagram.jison';
|
|
||||||
import { setConfig } from '../../../config.js';
|
|
||||||
|
|
||||||
setConfig({
|
|
||||||
securityLevel: 'strict',
|
|
||||||
});
|
|
||||||
|
|
||||||
describe.each([
|
|
||||||
['Component', 'component'],
|
|
||||||
['ComponentDb', 'component_db'],
|
|
||||||
['ComponentQueue', 'component_queue'],
|
|
||||||
['Component_Ext', 'external_component'],
|
|
||||||
['ComponentDb_Ext', 'external_component_db'],
|
|
||||||
['ComponentQueue_Ext', 'external_component_queue'],
|
|
||||||
])('parsing a C4 %s', function (macroName, elementName) {
|
|
||||||
beforeEach(function () {
|
|
||||||
c4.parser.yy = c4Db;
|
|
||||||
c4.parser.yy.clear();
|
|
||||||
});
|
|
||||||
|
|
||||||
it('should parse a C4 diagram with one Component correctly', function () {
|
|
||||||
c4.parser.parse(`C4Component
|
|
||||||
title Component diagram for Internet Banking Component
|
|
||||||
${macroName}(ComponentAA, "Internet Banking Component", "Technology", "Allows customers to view information about their bank accounts, and make payments.")`);
|
|
||||||
|
|
||||||
const yy = c4.parser.yy;
|
|
||||||
|
|
||||||
const shapes = yy.getC4ShapeArray();
|
|
||||||
expect(shapes.length).toBe(1);
|
|
||||||
const onlyShape = shapes[0];
|
|
||||||
|
|
||||||
expect(onlyShape).toMatchObject({
|
|
||||||
alias: 'ComponentAA',
|
|
||||||
descr: {
|
|
||||||
text: 'Allows customers to view information about their bank accounts, and make payments.',
|
|
||||||
},
|
|
||||||
label: {
|
|
||||||
text: 'Internet Banking Component',
|
|
||||||
},
|
|
||||||
techn: {
|
|
||||||
text: 'Technology',
|
|
||||||
},
|
|
||||||
typeC4Shape: {
|
|
||||||
text: elementName,
|
|
||||||
},
|
|
||||||
});
|
|
||||||
});
|
|
||||||
|
|
||||||
it('should handle a trailing whitespaces after Component', function () {
|
|
||||||
const whitespace = ' ';
|
|
||||||
const rendered = c4.parser.parse(`C4Component${whitespace}
|
|
||||||
title Component diagram for Internet Banking Component${whitespace}
|
|
||||||
${macroName}(ComponentAA, "Internet Banking Component", "Technology", "Allows customers to view information about their bank accounts, and make payments.")${whitespace}`);
|
|
||||||
|
|
||||||
expect(rendered).toBe(true);
|
|
||||||
});
|
|
||||||
});
|
|
@@ -158,10 +158,10 @@ accDescr\s*"{"\s* { this.begin("acc_descr_multiline");}
|
|||||||
"UpdateRelStyle" { this.begin("update_rel_style"); return 'UPDATE_REL_STYLE';}
|
"UpdateRelStyle" { this.begin("update_rel_style"); return 'UPDATE_REL_STYLE';}
|
||||||
"UpdateLayoutConfig" { this.begin("update_layout_config"); return 'UPDATE_LAYOUT_CONFIG';}
|
"UpdateLayoutConfig" { this.begin("update_layout_config"); return 'UPDATE_LAYOUT_CONFIG';}
|
||||||
|
|
||||||
<person,person_ext,system_ext_queue,system_ext_db,system_ext,system_queue,system_db,system,boundary,enterprise_boundary,system_boundary,container_ext_db,container_ext_queue,container_ext,container_queue,container_db,container,container_boundary,component_ext_db,component_ext_queue,component_ext,component_queue,component_db,component,node,node_l,node_r,rel,birel,rel_u,rel_d,rel_l,rel_r,rel_b,rel_index,update_el_style,update_rel_style,update_layout_config><<EOF>> return "EOF_IN_STRUCT";
|
<person,person_ext,system_ext_queue,system_ext_db,system_ext,system_queue,system_db,system,boundary,enterprise_boundary,system_boundary,container_ext_db,container_ext_queue,container_ext,container_queue,container_db,container,container_boundary,component_ext_db,component_ext,component_queue,component_db,component,node,node_l,node_r,rel,birel,rel_u,rel_d,rel_l,rel_r,rel_b,rel_index,update_el_style,update_rel_style,update_layout_config><<EOF>> return "EOF_IN_STRUCT";
|
||||||
<person,person_ext,system_ext_queue,system_ext_db,system_ext,system_queue,system_db,system,boundary,enterprise_boundary,system_boundary,container_ext_db,container_ext_queue,container_ext,container_queue,container_db,container,container_boundary,component_ext_db,component_ext_queue,component_ext,component_queue,component_db,component,node,node_l,node_r,rel,birel,rel_u,rel_d,rel_l,rel_r,rel_b,rel_index,update_el_style,update_rel_style,update_layout_config>[(][ ]*[,] { this.begin("attribute"); return "ATTRIBUTE_EMPTY";}
|
<person,person_ext,system_ext_queue,system_ext_db,system_ext,system_queue,system_db,system,boundary,enterprise_boundary,system_boundary,container_ext_db,container_ext_queue,container_ext,container_queue,container_db,container,container_boundary,component_ext_db,component_ext,component_queue,component_db,component,node,node_l,node_r,rel,birel,rel_u,rel_d,rel_l,rel_r,rel_b,rel_index,update_el_style,update_rel_style,update_layout_config>[(][ ]*[,] { this.begin("attribute"); return "ATTRIBUTE_EMPTY";}
|
||||||
<person,person_ext,system_ext_queue,system_ext_db,system_ext,system_queue,system_db,system,boundary,enterprise_boundary,system_boundary,container_ext_db,container_ext_queue,container_ext,container_queue,container_db,container,container_boundary,component_ext_db,component_ext_queue,component_ext,component_queue,component_db,component,node,node_l,node_r,rel,birel,rel_u,rel_d,rel_l,rel_r,rel_b,rel_index,update_el_style,update_rel_style,update_layout_config>[(] { this.begin("attribute"); }
|
<person,person_ext,system_ext_queue,system_ext_db,system_ext,system_queue,system_db,system,boundary,enterprise_boundary,system_boundary,container_ext_db,container_ext_queue,container_ext,container_queue,container_db,container,container_boundary,component_ext_db,component_ext,component_queue,component_db,component,node,node_l,node_r,rel,birel,rel_u,rel_d,rel_l,rel_r,rel_b,rel_index,update_el_style,update_rel_style,update_layout_config>[(] { this.begin("attribute"); }
|
||||||
<person,person_ext,system_ext_queue,system_ext_db,system_ext,system_queue,system_db,system,boundary,enterprise_boundary,system_boundary,container_ext_db,container_ext_queue,container_ext,container_queue,container_db,container,container_boundary,component_ext_db,component_ext_queue,component_ext,component_queue,component_db,component,node,node_l,node_r,rel,birel,rel_u,rel_d,rel_l,rel_r,rel_b,rel_index,update_el_style,update_rel_style,update_layout_config,attribute>[)] { this.popState();this.popState();}
|
<person,person_ext,system_ext_queue,system_ext_db,system_ext,system_queue,system_db,system,boundary,enterprise_boundary,system_boundary,container_ext_db,container_ext_queue,container_ext,container_queue,container_db,container,container_boundary,component_ext_db,component_ext,component_queue,component_db,component,node,node_l,node_r,rel,birel,rel_u,rel_d,rel_l,rel_r,rel_b,rel_index,update_el_style,update_rel_style,update_layout_config,attribute>[)] { this.popState();this.popState();}
|
||||||
|
|
||||||
<attribute>",," { return 'ATTRIBUTE_EMPTY';}
|
<attribute>",," { return 'ATTRIBUTE_EMPTY';}
|
||||||
<attribute>"," { }
|
<attribute>"," { }
|
||||||
|
@@ -15,7 +15,7 @@ title: Animal example
|
|||||||
classDiagram
|
classDiagram
|
||||||
note "From Duck till Zebra"
|
note "From Duck till Zebra"
|
||||||
Animal <|-- Duck
|
Animal <|-- Duck
|
||||||
note for Duck "can fly\ncan swim\ncan dive\ncan help in debugging"
|
note for Duck "can fly<br>can swim<br>can dive<br>can help in debugging"
|
||||||
Animal <|-- Fish
|
Animal <|-- Fish
|
||||||
Animal <|-- Zebra
|
Animal <|-- Zebra
|
||||||
Animal : +int age
|
Animal : +int age
|
||||||
|
Reference in New Issue
Block a user