From 5b1e65ac14905fb0d68721cd8d4fc3286c6ae335 Mon Sep 17 00:00:00 2001 From: Simon Brown Date: Tue, 24 Oct 2023 15:29:03 +0100 Subject: [PATCH] Fixes https://github.com/structurizr/export/issues/80 --- docs/changelog.md | 1 + .../export/mermaid/MermaidDiagramExporter.java | 2 +- .../structurizr/export/mermaid/36141-Components.mmd | 2 +- .../structurizr/export/mermaid/36141-Containers.mmd | 2 +- .../export/mermaid/36141-DevelopmentDeployment.mmd | 2 +- .../export/mermaid/36141-LiveDeployment.mmd | 2 +- .../com/structurizr/export/mermaid/36141-SignIn.mmd | 2 +- .../structurizr/export/mermaid/36141-SystemContext.mmd | 2 +- .../export/mermaid/36141-SystemLandscape.mmd | 2 +- .../mermaid/54915-AmazonWebServicesDeployment.mmd | 2 +- .../export/mermaid/MermaidDiagramExporterTests.java | 10 +++++----- .../structurizr/export/mermaid/groups-Components.mmd | 2 +- .../structurizr/export/mermaid/groups-Containers.mmd | 2 +- .../export/mermaid/groups-SystemLandscape.mmd | 2 +- .../com/structurizr/export/mermaid/nested-groups.mmd | 2 +- 15 files changed, 19 insertions(+), 18 deletions(-) diff --git a/docs/changelog.md b/docs/changelog.md index eb233e9..a026552 100644 --- a/docs/changelog.md +++ b/docs/changelog.md @@ -3,6 +3,7 @@ ## 1.17.0 (unreleased) - C4PlantUMLExporter: Adds support for border style and stroke width (see https://github.com/structurizr/export/issues/73). +- MermaidDiagramExporter: Fixes https://github.com/structurizr/export/issues/80 ## 1.16.1 (11th August 2023) diff --git a/src/main/java/com/structurizr/export/mermaid/MermaidDiagramExporter.java b/src/main/java/com/structurizr/export/mermaid/MermaidDiagramExporter.java index a4ff016..54b6b26 100644 --- a/src/main/java/com/structurizr/export/mermaid/MermaidDiagramExporter.java +++ b/src/main/java/com/structurizr/export/mermaid/MermaidDiagramExporter.java @@ -65,7 +65,7 @@ protected void writeHeader(ModelView view, IndentingWriter writer) { } } - writer.writeLine("subgraph diagram [" + viewTitle + "]"); + writer.writeLine("subgraph diagram [\"" + viewTitle + "\"]"); writer.indent(); writer.writeLine("style diagram fill:#ffffff,stroke:#ffffff"); writer.writeLine(); diff --git a/src/test/java/com/structurizr/export/mermaid/36141-Components.mmd b/src/test/java/com/structurizr/export/mermaid/36141-Components.mmd index 697cc6e..dcae0ac 100644 --- a/src/test/java/com/structurizr/export/mermaid/36141-Components.mmd +++ b/src/test/java/com/structurizr/export/mermaid/36141-Components.mmd @@ -1,7 +1,7 @@ graph TB linkStyle default fill:#ffffff - subgraph diagram [Internet Banking System - API Application - Components] + subgraph diagram ["Internet Banking System - API Application - Components"] style diagram fill:#ffffff,stroke:#ffffff 4["
Mainframe Banking System
[Software System]
Stores all of the core
banking information about
customers, accounts,
transactions, etc.
"] diff --git a/src/test/java/com/structurizr/export/mermaid/36141-Containers.mmd b/src/test/java/com/structurizr/export/mermaid/36141-Containers.mmd index b6415e7..4cda955 100644 --- a/src/test/java/com/structurizr/export/mermaid/36141-Containers.mmd +++ b/src/test/java/com/structurizr/export/mermaid/36141-Containers.mmd @@ -1,7 +1,7 @@ graph TB linkStyle default fill:#ffffff - subgraph diagram [Internet Banking System - Containers] + subgraph diagram ["Internet Banking System - Containers"] style diagram fill:#ffffff,stroke:#ffffff 1["
Personal Banking Customer
[Person]
A customer of the bank, with
personal bank accounts.
"] diff --git a/src/test/java/com/structurizr/export/mermaid/36141-DevelopmentDeployment.mmd b/src/test/java/com/structurizr/export/mermaid/36141-DevelopmentDeployment.mmd index dc5abc4..14b3194 100644 --- a/src/test/java/com/structurizr/export/mermaid/36141-DevelopmentDeployment.mmd +++ b/src/test/java/com/structurizr/export/mermaid/36141-DevelopmentDeployment.mmd @@ -1,7 +1,7 @@ graph TB linkStyle default fill:#ffffff - subgraph diagram [Internet Banking System - Deployment - Development] + subgraph diagram ["Internet Banking System - Deployment - Development"] style diagram fill:#ffffff,stroke:#ffffff subgraph 50 [Developer Laptop] diff --git a/src/test/java/com/structurizr/export/mermaid/36141-LiveDeployment.mmd b/src/test/java/com/structurizr/export/mermaid/36141-LiveDeployment.mmd index 011f7cc..73b4fb2 100644 --- a/src/test/java/com/structurizr/export/mermaid/36141-LiveDeployment.mmd +++ b/src/test/java/com/structurizr/export/mermaid/36141-LiveDeployment.mmd @@ -1,7 +1,7 @@ graph TB linkStyle default fill:#ffffff - subgraph diagram [Internet Banking System - Deployment - Live] + subgraph diagram ["Internet Banking System - Deployment - Live"] style diagram fill:#ffffff,stroke:#ffffff subgraph 67 [Customer's mobile device] diff --git a/src/test/java/com/structurizr/export/mermaid/36141-SignIn.mmd b/src/test/java/com/structurizr/export/mermaid/36141-SignIn.mmd index 4c6367d..ad523b0 100644 --- a/src/test/java/com/structurizr/export/mermaid/36141-SignIn.mmd +++ b/src/test/java/com/structurizr/export/mermaid/36141-SignIn.mmd @@ -1,7 +1,7 @@ graph TB linkStyle default fill:#ffffff - subgraph diagram [API Application - Dynamic] + subgraph diagram ["API Application - Dynamic"] style diagram fill:#ffffff,stroke:#ffffff subgraph 20 [API Application] diff --git a/src/test/java/com/structurizr/export/mermaid/36141-SystemContext.mmd b/src/test/java/com/structurizr/export/mermaid/36141-SystemContext.mmd index f7c4045..1843356 100644 --- a/src/test/java/com/structurizr/export/mermaid/36141-SystemContext.mmd +++ b/src/test/java/com/structurizr/export/mermaid/36141-SystemContext.mmd @@ -1,7 +1,7 @@ graph TB linkStyle default fill:#ffffff - subgraph diagram [Internet Banking System - System Context] + subgraph diagram ["Internet Banking System - System Context"] style diagram fill:#ffffff,stroke:#ffffff 1["
Personal Banking Customer
[Person]
A customer of the bank, with
personal bank accounts.
"] diff --git a/src/test/java/com/structurizr/export/mermaid/36141-SystemLandscape.mmd b/src/test/java/com/structurizr/export/mermaid/36141-SystemLandscape.mmd index da3f847..9e38298 100644 --- a/src/test/java/com/structurizr/export/mermaid/36141-SystemLandscape.mmd +++ b/src/test/java/com/structurizr/export/mermaid/36141-SystemLandscape.mmd @@ -1,7 +1,7 @@ graph TB linkStyle default fill:#ffffff - subgraph diagram [System Landscape] + subgraph diagram ["System Landscape"] style diagram fill:#ffffff,stroke:#ffffff subgraph enterprise [Big Bank plc] diff --git a/src/test/java/com/structurizr/export/mermaid/54915-AmazonWebServicesDeployment.mmd b/src/test/java/com/structurizr/export/mermaid/54915-AmazonWebServicesDeployment.mmd index feb4c23..dac7a2f 100644 --- a/src/test/java/com/structurizr/export/mermaid/54915-AmazonWebServicesDeployment.mmd +++ b/src/test/java/com/structurizr/export/mermaid/54915-AmazonWebServicesDeployment.mmd @@ -1,7 +1,7 @@ graph LR linkStyle default fill:#ffffff - subgraph diagram [Spring PetClinic - Deployment - Live] + subgraph diagram ["Spring PetClinic - Deployment - Live"] style diagram fill:#ffffff,stroke:#ffffff subgraph 5 [Amazon Web Services] diff --git a/src/test/java/com/structurizr/export/mermaid/MermaidDiagramExporterTests.java b/src/test/java/com/structurizr/export/mermaid/MermaidDiagramExporterTests.java index 0c4cad8..7abc02d 100644 --- a/src/test/java/com/structurizr/export/mermaid/MermaidDiagramExporterTests.java +++ b/src/test/java/com/structurizr/export/mermaid/MermaidDiagramExporterTests.java @@ -145,7 +145,7 @@ public void test_renderContainerDiagramWithExternalContainers() { assertEquals("graph TB\n" + " linkStyle default fill:#ffffff\n" + "\n" + - " subgraph diagram [Software System 1 - Containers]\n" + + " subgraph diagram [\"Software System 1 - Containers\"]\n" + " style diagram fill:#ffffff,stroke:#ffffff\n" + "\n" + " subgraph 1 [Software System 1]\n" + @@ -186,7 +186,7 @@ public void test_renderComponentDiagramWithExternalComponents() { assertEquals("graph TB\n" + " linkStyle default fill:#ffffff\n" + "\n" + - " subgraph diagram [Software System 1 - Container 1 - Components]\n" + + " subgraph diagram [\"Software System 1 - Container 1 - Components\"]\n" + " style diagram fill:#ffffff,stroke:#ffffff\n" + "\n" + " subgraph 2 [Container 1]\n" + @@ -225,7 +225,7 @@ public void test_renderGroupStyles() { assertEquals("graph TB\n" + " linkStyle default fill:#ffffff\n" + "\n" + - " subgraph diagram [System Landscape]\n" + + " subgraph diagram [\"System Landscape\"]\n" + " style diagram fill:#ffffff,stroke:#ffffff\n" + "\n" + " subgraph group1 [Group 1]\n" + @@ -258,7 +258,7 @@ public void test_renderGroupStyles() { assertEquals("graph TB\n" + " linkStyle default fill:#ffffff\n" + "\n" + - " subgraph diagram [System Landscape]\n" + + " subgraph diagram [\"System Landscape\"]\n" + " style diagram fill:#ffffff,stroke:#ffffff\n" + "\n" + " subgraph group1 [Group 1]\n" + @@ -302,7 +302,7 @@ public void test_renderCustomView() { assertEquals("graph TB\n" + " linkStyle default fill:#ffffff\n" + "\n" + - " subgraph diagram [Title]\n" + + " subgraph diagram [\"Title\"]\n" + " style diagram fill:#ffffff,stroke:#ffffff\n" + "\n" + " 1[\"
A
\"]\n" + diff --git a/src/test/java/com/structurizr/export/mermaid/groups-Components.mmd b/src/test/java/com/structurizr/export/mermaid/groups-Components.mmd index 75b610e..79c389e 100644 --- a/src/test/java/com/structurizr/export/mermaid/groups-Components.mmd +++ b/src/test/java/com/structurizr/export/mermaid/groups-Components.mmd @@ -1,7 +1,7 @@ graph TB linkStyle default fill:#ffffff - subgraph diagram [D - F - Components] + subgraph diagram ["D - F - Components"] style diagram fill:#ffffff,stroke:#ffffff 3["
C
[Software System]
"] diff --git a/src/test/java/com/structurizr/export/mermaid/groups-Containers.mmd b/src/test/java/com/structurizr/export/mermaid/groups-Containers.mmd index 2fd2635..3c5abba 100644 --- a/src/test/java/com/structurizr/export/mermaid/groups-Containers.mmd +++ b/src/test/java/com/structurizr/export/mermaid/groups-Containers.mmd @@ -1,7 +1,7 @@ graph TB linkStyle default fill:#ffffff - subgraph diagram [D - Containers] + subgraph diagram ["D - Containers"] style diagram fill:#ffffff,stroke:#ffffff 3["
C
[Software System]
"] diff --git a/src/test/java/com/structurizr/export/mermaid/groups-SystemLandscape.mmd b/src/test/java/com/structurizr/export/mermaid/groups-SystemLandscape.mmd index f2fde81..5ca147d 100644 --- a/src/test/java/com/structurizr/export/mermaid/groups-SystemLandscape.mmd +++ b/src/test/java/com/structurizr/export/mermaid/groups-SystemLandscape.mmd @@ -1,7 +1,7 @@ graph TB linkStyle default fill:#ffffff - subgraph diagram [System Landscape] + subgraph diagram ["System Landscape"] style diagram fill:#ffffff,stroke:#ffffff subgraph enterprise [Enterprise] diff --git a/src/test/java/com/structurizr/export/mermaid/nested-groups.mmd b/src/test/java/com/structurizr/export/mermaid/nested-groups.mmd index 934e75e..e48b4e3 100644 --- a/src/test/java/com/structurizr/export/mermaid/nested-groups.mmd +++ b/src/test/java/com/structurizr/export/mermaid/nested-groups.mmd @@ -1,7 +1,7 @@ graph TB linkStyle default fill:#ffffff - subgraph diagram [System Landscape] + subgraph diagram ["System Landscape"] style diagram fill:#ffffff,stroke:#ffffff subgraph group1 [Organisation 1]