Treat all text in a code block as plain, i.e. don't format based on markdown.
This commit is contained in:
@@ -5,6 +5,7 @@
|
|||||||
|
|
||||||
#include <QTextCursor>
|
#include <QTextCursor>
|
||||||
#include <QTextDocument>
|
#include <QTextDocument>
|
||||||
|
#include <qnamespace.h>
|
||||||
#include <qtextcursor.h>
|
#include <qtextcursor.h>
|
||||||
|
|
||||||
#include "chattextitemhelper.h"
|
#include "chattextitemhelper.h"
|
||||||
@@ -188,7 +189,7 @@ void ChatMarkdownHelper::checkMarkdown(int position, int charsRemoved, int chars
|
|||||||
// This can happen when formatting is applied.
|
// This can happen when formatting is applied.
|
||||||
if (charsAdded == charsRemoved) {
|
if (charsAdded == charsRemoved) {
|
||||||
return;
|
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));
|
updatePosition(std::max(0, position - charsRemoved + charsAdded));
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user