Make sure that apostrophes are unescaped when visualising messages

Title

BUG: 488325
This commit is contained in:
James Graham
2024-07-23 17:27:00 +00:00
parent 9df4cd6f13
commit 11475259a1
2 changed files with 2 additions and 0 deletions

View File

@@ -274,6 +274,7 @@ void TextHandlerTest::receiveRichInPlainOut_data()
QTest::newRow("ampersand") << QStringLiteral("a &amp; b") << QStringLiteral("a & b");
QTest::newRow("quote") << QStringLiteral("&quot;a and b&quot;") << QStringLiteral("\"a and b\"");
QTest::newRow("new line") << QStringLiteral("new<br>line") << QStringLiteral("new\nline");
QTest::newRow("unescape") << QStringLiteral("can&#x27;t") << QStringLiteral("can't");
}
void TextHandlerTest::receiveRichInPlainOut()

View File

@@ -614,6 +614,7 @@ QString TextHandler::unescapeHtml(QString stringIn)
stringIn.replace(QStringLiteral("&gt;"), QStringLiteral(">"));
stringIn.replace(QStringLiteral("&amp;"), QStringLiteral("&"));
stringIn.replace(QStringLiteral("&quot;"), QStringLiteral("\""));
stringIn.replace(QStringLiteral("&#x27;"), QStringLiteral("'"));
return stringIn;
}