From 11475259a180aec98022f905be59420870078c8f Mon Sep 17 00:00:00 2001 From: James Graham Date: Tue, 23 Jul 2024 17:27:00 +0000 Subject: [PATCH] Make sure that apostrophes are unescaped when visualising messages Title BUG: 488325 --- autotests/texthandlertest.cpp | 1 + src/texthandler.cpp | 1 + 2 files changed, 2 insertions(+) diff --git a/autotests/texthandlertest.cpp b/autotests/texthandlertest.cpp index b943b0182..f2b5b6c29 100644 --- a/autotests/texthandlertest.cpp +++ b/autotests/texthandlertest.cpp @@ -274,6 +274,7 @@ void TextHandlerTest::receiveRichInPlainOut_data() QTest::newRow("ampersand") << QStringLiteral("a & b") << QStringLiteral("a & b"); QTest::newRow("quote") << QStringLiteral(""a and b"") << QStringLiteral("\"a and b\""); QTest::newRow("new line") << QStringLiteral("new
line") << QStringLiteral("new\nline"); + QTest::newRow("unescape") << QStringLiteral("can't") << QStringLiteral("can't"); } void TextHandlerTest::receiveRichInPlainOut() diff --git a/src/texthandler.cpp b/src/texthandler.cpp index f15dcc203..c3e02b4b4 100644 --- a/src/texthandler.cpp +++ b/src/texthandler.cpp @@ -614,6 +614,7 @@ QString TextHandler::unescapeHtml(QString stringIn) stringIn.replace(QStringLiteral(">"), QStringLiteral(">")); stringIn.replace(QStringLiteral("&"), QStringLiteral("&")); stringIn.replace(QStringLiteral("""), QStringLiteral("\"")); + stringIn.replace(QStringLiteral("'"), QStringLiteral("'")); return stringIn; }