From daa66c4abcac923d1e6ddaa569fd3ffdffdca2d7 Mon Sep 17 00:00:00 2001 From: James Graham Date: Fri, 27 Feb 2026 13:30:30 +0000 Subject: [PATCH] Treat all text in a code block as plain, i.e. don't format based on markdown. --- src/libneochat/chatmarkdownhelper.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/libneochat/chatmarkdownhelper.cpp b/src/libneochat/chatmarkdownhelper.cpp index 7560f551c..44b2f580e 100644 --- a/src/libneochat/chatmarkdownhelper.cpp +++ b/src/libneochat/chatmarkdownhelper.cpp @@ -5,6 +5,7 @@ #include #include +#include #include #include "chattextitemhelper.h" @@ -188,7 +189,7 @@ void ChatMarkdownHelper::checkMarkdown(int position, int charsRemoved, int chars // This can happen when formatting is applied. if (charsAdded == charsRemoved) { return; - } else if (m_textItem->isCompleting || charsRemoved > charsAdded || charsAdded - charsRemoved > 1) { + } else if ((m_textItem->textFormat() && m_textItem->textFormat() == Qt::TextFormat::PlainText) || m_textItem->isCompleting || charsRemoved > charsAdded || charsAdded - charsRemoved > 1) { updatePosition(std::max(0, position - charsRemoved + charsAdded)); return; }