From c554c40b3bfc2e0743cceb3e3d2b17737a5dbe64 Mon Sep 17 00:00:00 2001 From: James Graham Date: Sat, 14 Feb 2026 16:00:46 +0000 Subject: [PATCH] Fix markdown helper test --- autotests/chatmarkdownhelpertest.qml | 1 + src/libneochat/chatmarkdownhelper.cpp | 4 ++++ src/messagecontent/models/eventmessagecontentmodel.cpp | 6 ++++++ 3 files changed, 11 insertions(+) diff --git a/autotests/chatmarkdownhelpertest.qml b/autotests/chatmarkdownhelpertest.qml index 8602033dd..a3519f529 100644 --- a/autotests/chatmarkdownhelpertest.qml +++ b/autotests/chatmarkdownhelpertest.qml @@ -70,6 +70,7 @@ TestCase { {tag: "heading 5", input: "##### h", outText: ["#", "##", "###", "####", "#####", "##### ", "h"], outFormats: [[], [], [], [], [], [], [RichFormat.Bold, RichFormat.Heading5]], unhandled: 0}, {tag: "heading 6", input: "###### h", outText: ["#", "##", "###", "####", "#####", "######", "###### ", "h"], outFormats: [[], [], [], [], [], [] ,[], [RichFormat.Bold, RichFormat.Heading6]], unhandled: 0}, {tag: "quote", input: "> q", outText: [">", "> ", "q"], outFormats: [[], [], []], unhandled: 1}, + {tag: "quote - no space", input: ">q", outText: [">", "q"], outFormats: [[], [], []], unhandled: 1}, {tag: "unorderedlist 1", input: "* l", outText: ["*", "* ", "l"], outFormats: [[], [], [RichFormat.UnorderedList]], unhandled: 0}, {tag: "unorderedlist 2", input: "- l", outText: ["-", "- ", "l"], outFormats: [[], [], [RichFormat.UnorderedList]], unhandled: 0}, {tag: "orderedlist 1", input: "1. l", outText: ["1", "1.", "1. ", "l"], outFormats: [[], [], [], [RichFormat.OrderedList]], unhandled: 0}, diff --git a/src/libneochat/chatmarkdownhelper.cpp b/src/libneochat/chatmarkdownhelper.cpp index ad32e21b2..ffaf865cc 100644 --- a/src/libneochat/chatmarkdownhelper.cpp +++ b/src/libneochat/chatmarkdownhelper.cpp @@ -50,6 +50,10 @@ const QList syntax = { MarkdownSyntax{.sequence = " >"_L1, .lineStart = true, .format = RichFormat::Quote}, MarkdownSyntax{.sequence = " >"_L1, .lineStart = true, .format = RichFormat::Quote}, MarkdownSyntax{.sequence = " >"_L1, .lineStart = true, .format = RichFormat::Quote}, + MarkdownSyntax{.sequence = "> "_L1, .lineStart = true, .format = RichFormat::Quote}, + MarkdownSyntax{.sequence = " > "_L1, .lineStart = true, .format = RichFormat::Quote}, + MarkdownSyntax{.sequence = " > "_L1, .lineStart = true, .format = RichFormat::Quote}, + MarkdownSyntax{.sequence = " > "_L1, .lineStart = true, .format = RichFormat::Quote}, MarkdownSyntax{.sequence = "* "_L1, .lineStart = true, .format = RichFormat::UnorderedList}, MarkdownSyntax{.sequence = " * "_L1, .lineStart = true, .format = RichFormat::UnorderedList}, MarkdownSyntax{.sequence = " * "_L1, .lineStart = true, .format = RichFormat::UnorderedList}, diff --git a/src/messagecontent/models/eventmessagecontentmodel.cpp b/src/messagecontent/models/eventmessagecontentmodel.cpp index d82ceb78e..8b0e09ef4 100644 --- a/src/messagecontent/models/eventmessagecontentmodel.cpp +++ b/src/messagecontent/models/eventmessagecontentmodel.cpp @@ -113,6 +113,12 @@ void EventMessageContentModel::initializeModel() } }); #if Quotient_VERSION_MINOR > 9 + connect(m_room, &Room::newThread, this, [this](const QString &newThread) { + if (newThread == m_eventId) { + resetContent(); + } + }); +#elif Quotient_VERSION_MINOR == 9 && Quotient_VERSION_PATCH >= 4 connect(m_room, &Room::newThread, this, [this](const Thread &newThread) { if (newThread.threadRootId == m_eventId) { resetContent();