From bdeb6c6278837b3a69a23cfa6824cff16470c9ff Mon Sep 17 00:00:00 2001 From: Guillaume Grossetie Date: Sun, 10 Nov 2024 18:04:09 +0100 Subject: [PATCH] fix(ditaa): pass argument values as separate arguments ref #1803 --- ci/tests/smoke.js | 1 + .../src/main/java/io/kroki/server/service/DitaaCommand.java | 6 ++++-- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/ci/tests/smoke.js b/ci/tests/smoke.js index c8580690f..86a81b80d 100755 --- a/ci/tests/smoke.js +++ b/ci/tests/smoke.js @@ -15,6 +15,7 @@ const tests = [ { engine: 'c4plantuml', file: 'banking-system.puml', options: {}, outputFormat: ['svg', 'pdf', 'png', 'txt'] }, { engine: 'dbml', file: 'dbml.dbml', options: {}, outputFormat: ['svg'] }, { engine: 'ditaa', file: 'components.ditaa', options: {}, outputFormat: ['svg'] }, + { engine: 'ditaa', file: 'components.ditaa', options: {scale: '0.7'}, outputFormat: ['svg'] }, { engine: 'symbolator', file: 'component.sv', options: {}, outputFormat: ['svg', 'png'] }, { engine: 'erd', file: 'schema.erd', options: {}, outputFormat: ['svg'] }, { engine: 'mermaid', file: 'contribute.mmd', options: {}, outputFormat: ['svg'] }, diff --git a/server/src/main/java/io/kroki/server/service/DitaaCommand.java b/server/src/main/java/io/kroki/server/service/DitaaCommand.java index 7308c7f5d..d4e6a05f6 100644 --- a/server/src/main/java/io/kroki/server/service/DitaaCommand.java +++ b/server/src/main/java/io/kroki/server/service/DitaaCommand.java @@ -38,7 +38,8 @@ public byte[] convert(String source, FileFormat format, JsonObject options) thro } String scale = options.getString("scale"); if (scale != null) { - commands.add("--scale " + scale); + commands.add("--scale"); + commands.add(scale); } String noShadows = options.getString("no-shadows"); if (noShadows != null) { @@ -46,7 +47,8 @@ public byte[] convert(String source, FileFormat format, JsonObject options) thro } String tabs = options.getString("tabs"); if (tabs != null) { - commands.add("--tabs " + tabs); + commands.add("--tabs"); + commands.add(tabs); } commands.add("-"); return commander.execute(source.getBytes(), commands.toArray(new String[0]));