From fdd36d4385d8e9c8ba5a77206ef75d02451142d8 Mon Sep 17 00:00:00 2001 From: Liam Date: Fri, 5 Jul 2024 21:12:25 +0100 Subject: [PATCH] fix markdown in the message breaking the log --- .../java/cc/fascinated/bat/features/logging/LogFeature.java | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/main/java/cc/fascinated/bat/features/logging/LogFeature.java b/src/main/java/cc/fascinated/bat/features/logging/LogFeature.java index 0a82dde..6f22bc7 100644 --- a/src/main/java/cc/fascinated/bat/features/logging/LogFeature.java +++ b/src/main/java/cc/fascinated/bat/features/logging/LogFeature.java @@ -58,6 +58,9 @@ public class LogFeature extends Feature { if (content == null) { return "No content"; } + if (content.contains("`")) { // Workaround for markdown formatting + content = content.replace("`", "'"); + } // More than 512 characters or is more than 4 lines if (content.length() > 512 || content.chars().filter(ch -> ch == '\n').count() > 4) { return "*Content too long, [click here to view]("+PasteUtils.uploadPaste(content).getUrl()+")*";