From 1059164b4a9d166a918b58f7104bc594a3b1baf7 Mon Sep 17 00:00:00 2001 From: Stephan Richter Date: Thu, 22 Jan 2026 20:46:43 +0100 Subject: [PATCH] =?UTF-8?q?bugfix:=20markdown=20rendering=20glitched=20whe?= =?UTF-8?q?n=20several=20@startuml=E2=80=A6@enduml=20sections=20were=20pre?= =?UTF-8?q?sent=20in=20one=20document?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Stephan Richter --- core/src/main/java/de/srsoftware/umbrella/core/Util.java | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/core/src/main/java/de/srsoftware/umbrella/core/Util.java b/core/src/main/java/de/srsoftware/umbrella/core/Util.java index ee909fa1..d869a805 100644 --- a/core/src/main/java/de/srsoftware/umbrella/core/Util.java +++ b/core/src/main/java/de/srsoftware/umbrella/core/Util.java @@ -35,7 +35,7 @@ import org.json.JSONObject; public class Util { public static final System.Logger LOG = System.getLogger("Util"); - private static final Pattern UML_PATTERN = Pattern.compile("@start(\\w+)(.*)@end(\\1)",Pattern.DOTALL); + private static final Pattern UML_PATTERN = Pattern.compile("@start(\\w+)(.*?)@end(\\1)",Pattern.DOTALL); private static File plantumlJar = null; private static final JParsedown MARKDOWN = new JParsedown(); public static final String SHA1 = "SHA-1"; @@ -79,7 +79,7 @@ public class Util { try { if (plantumlJar != null && plantumlJar.exists()) { var matcher = UML_PATTERN.matcher(source); - if (matcher.find()) { + while (matcher.find()) { var uml = matcher.group(0).trim(); var start = matcher.start(0); var end = matcher.end(0); @@ -96,6 +96,7 @@ public class Util { byte[] out = is.readAllBytes(); var svg = new String(out, UTF_8); source = source.substring(0, start) + svg + source.substring(end); + matcher = UML_PATTERN.matcher(source); } } }