diff --git a/src/qml/RichLabel.qml b/src/qml/RichLabel.qml index 82902d039..097f84b11 100644 --- a/src/qml/RichLabel.qml +++ b/src/qml/RichLabel.qml @@ -67,6 +67,18 @@ table td { border: 1px solid black; padding: 3px; } +blockquote { + margin: 0; +} +blockquote table { + width: 100%; + border-width: 0; + background-color:" + Kirigami.Theme.alternateBackgroundColor + "; +} +blockquote td { + width: 100%; + padding: " + Kirigami.Units.largeSpacing + "; +} pre { white-space: pre-wrap } diff --git a/src/texthandler.cpp b/src/texthandler.cpp index c5a9147ee..c228f43bf 100644 --- a/src/texthandler.cpp +++ b/src/texthandler.cpp @@ -134,6 +134,10 @@ QString TextHandler::handleRecieveRichText(Qt::TextFormat inputFormat, const Neo nextTokenType(); } + // Apply user style to blockquotes + // Unfortunately some attributes can be only be used on table cells, so we need to wrap the content in one. + outputString.replace(TextRegex::blockQuote, QStringLiteral(R"(
)")); + // If the message is an emote add the user pill to the front of the message. if (event != nullptr) { auto e = eventCast
“\1”
]*>(.*?)"), QRegularExpression::DotMatchesEverythingOption};
static const QRegularExpression userPill{QStringLiteral("(.*?)"), QRegularExpression::DotMatchesEverythingOption};
+static const QRegularExpression blockQuote{QStringLiteral("\n?(?:"), + QRegularExpression::DotMatchesEverythingOption}; static const QRegularExpression strikethrough{QStringLiteral(")?(.*?)(?:
)?\n?