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