Skip to content
This repository has been archived by the owner on Jan 11, 2024. It is now read-only.

Commit

Permalink
Explicitly request PNG format from Mermaid servers.
Browse files Browse the repository at this point in the history
  • Loading branch information
simonbrowndotje committed Feb 18, 2023
1 parent 0fea5da commit 99952d7
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 3 deletions.
2 changes: 1 addition & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ targetCompatibility = 1.8

description = 'Utilities to import diagrams and documentation into a Structurizr workspace'
group = 'com.structurizr'
version = '1.2.0'
version = '1.2.1'

test {
useJUnitPlatform()
Expand Down
4 changes: 4 additions & 0 deletions docs/changelog.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
# Changelog

## 1.2.1 (18th February 2023)

- Explicitly request PNG format from Mermaid servers.

## 1.2.0 (16th February 2023)

- __Breaking change__: Renamed artifact from `structurizr-documentation` to `structurizr-import`.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ public void importDiagram(ImageView view, String content) {
}

String encodedMermaid = new MermaidEncoder().encode(content);
String url = String.format("%s/img/%s", mermaidServer, encodedMermaid);
String url = String.format("%s/img/%s?type=png", mermaidServer, encodedMermaid);
view.setContent(url);
view.setContentType(CONTENT_TYPE_IMAGE_PNG);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ public void test_import() throws Exception {
assertNull(view.getElement());
assertNull(view.getElementId());
assertEquals("flowchart.mmd", view.getTitle());
assertEquals("https://mermaid.ink/img/eyAiY29kZSI6ImZsb3djaGFydCBURFxuICAgIFN0YXJ0IC0tPiBTdG9wIiwgIm1lcm1haWQiOnsidGhlbWUiOiJkZWZhdWx0In19", view.getContent());
assertEquals("https://mermaid.ink/img/eyAiY29kZSI6ImZsb3djaGFydCBURFxuICAgIFN0YXJ0IC0tPiBTdG9wIiwgIm1lcm1haWQiOnsidGhlbWUiOiJkZWZhdWx0In19?type=png", view.getContent());
}

@Test
Expand Down

0 comments on commit 99952d7

Please sign in to comment.