Fix multi line quotes
This commit is contained in:
@@ -3,7 +3,6 @@
|
||||
|
||||
#include "chatkeyhelper.h"
|
||||
|
||||
#include "chatbarcache.h"
|
||||
#include "chattextitemhelper.h"
|
||||
#include "clipboard.h"
|
||||
#include "neochatroom.h"
|
||||
|
||||
@@ -75,7 +75,6 @@ QQC2.TextArea {
|
||||
|
||||
text: root.editable ? "" : root.display
|
||||
selectByMouse: true
|
||||
persistentSelection: true
|
||||
readOnly: !root.editable
|
||||
textFormat: TextEdit.RichText
|
||||
wrapMode: TextEdit.Wrap
|
||||
|
||||
@@ -87,7 +87,6 @@ TextEdit {
|
||||
|
||||
leftPadding: Kirigami.Units.smallSpacing
|
||||
rightPadding: Kirigami.Units.smallSpacing
|
||||
persistentSelection: true
|
||||
|
||||
text: root.editable ? "" : display
|
||||
|
||||
|
||||
@@ -543,7 +543,7 @@ inline QString formatQuote(const QString &input)
|
||||
string.removeLast();
|
||||
}
|
||||
if (!stringOut.isEmpty()) {
|
||||
stringOut += u"\n\n"_s;
|
||||
stringOut += u"\n"_s;
|
||||
}
|
||||
stringOut += u"> "_s + string;
|
||||
}
|
||||
@@ -562,6 +562,7 @@ QString ChatBarMessageContentModel::messageText() const
|
||||
if (MessageComponentType::isTextType(component.type)) {
|
||||
if (const auto textItem = textItemForComponent(component)) {
|
||||
auto newText = textItem->markdownText();
|
||||
newText.replace(QRegularExpression(u"(?<!\n)\n(?!\n)"_s), u" "_s);
|
||||
if (component.type == MessageComponentType::Quote) {
|
||||
newText = formatQuote(newText);
|
||||
} else if (component.type == MessageComponentType::Code) {
|
||||
|
||||
Reference in New Issue
Block a user