diff --git a/docs/changelog.md b/docs/changelog.md index 90dac7a..926926d 100644 --- a/docs/changelog.md +++ b/docs/changelog.md @@ -1,11 +1,16 @@ # Changelog +## (unreleased) + +- C4PlantUMLExporter: Fixes #83 (C4Plantuml export renders url property in wrong format). + ## 1.17.0 (27th October 2023) - C4PlantUMLExporter: Adds support for border style and stroke width (#73). - C4PlantUMLExporter: Adds support for sequence diagrams (#66). - C4PlantUMLExporter: Relationships are now rendered as `Rel` rather than `Rel_D`. - MermaidDiagramExporter: Fixes #80 (Mermaid render error when description contains `(` character). +- Updated dependencies and minimum Java version (17). ## 1.16.1 (11th August 2023) diff --git a/src/main/java/com/structurizr/export/plantuml/C4PlantUMLExporter.java b/src/main/java/com/structurizr/export/plantuml/C4PlantUMLExporter.java index 6266578..1d7d87a 100644 --- a/src/main/java/com/structurizr/export/plantuml/C4PlantUMLExporter.java +++ b/src/main/java/com/structurizr/export/plantuml/C4PlantUMLExporter.java @@ -473,9 +473,7 @@ protected void writeElement(ModelView view, Element element, IndentingWriter wri if (StringUtils.isNullOrEmpty(url)) { url = element.getUrl(); - if (!StringUtils.isNullOrEmpty(url)) { - url = "[[" + url + "]]"; - } else { + if (StringUtils.isNullOrEmpty(url)) { url = ""; } } diff --git a/src/test/java/com/structurizr/export/plantuml/C4PlantUMLDiagramExporterTests.java b/src/test/java/com/structurizr/export/plantuml/C4PlantUMLDiagramExporterTests.java index 0529194..d207920 100644 --- a/src/test/java/com/structurizr/export/plantuml/C4PlantUMLDiagramExporterTests.java +++ b/src/test/java/com/structurizr/export/plantuml/C4PlantUMLDiagramExporterTests.java @@ -726,4 +726,30 @@ public void borderStyling() { "@enduml", diagram.getDefinition()); } -} + @Test + public void elementWithUrl() { + Workspace workspace = new Workspace("Name", "Description"); + workspace.getModel().addSoftwareSystem("Name").setUrl("https://example.com"); + + SystemLandscapeView view = workspace.getViews().createSystemLandscapeView("key", "Description"); + view.addAllElements(); + + Diagram diagram = new C4PlantUMLExporter().export(view); + assertEquals(""" + @startuml + set separator none + title System Landscape + + top to bottom direction + + !include + !include + + System(Name, "Name", $descr="", $tags="", $link="https://example.com") + + + SHOW_LEGEND(true) + @enduml""", diagram.getDefinition()); + } + +} \ No newline at end of file