Make emoji escaping less aggressive

This commit is contained in:
Nicolas Werner 2022-09-16 15:17:24 +02:00
parent 0ebd0b0526
commit cd08a130c6
No known key found for this signature in database
GPG key ID: C8D75E610773F2D9

View file

@ -131,8 +131,14 @@ utils::replaceEmoji(const QString &body)
QVector<uint> utf32_string = body.toUcs4(); QVector<uint> utf32_string = body.toUcs4();
bool insideFontBlock = false; bool insideFontBlock = false;
bool insideTag = false;
for (auto &code : utf32_string) { for (auto &code : utf32_string) {
if (utils::codepointIsEmoji(code)) { if (code == U'<')
insideTag = true;
else if (code == U'>')
insideTag = false;
if (!insideTag && utils::codepointIsEmoji(code)) {
if (!insideFontBlock) { if (!insideFontBlock) {
fmtBody += QStringLiteral("<font face=\"") % UserSettings::instance()->emojiFont() % fmtBody += QStringLiteral("<font face=\"") % UserSettings::instance()->emojiFont() %
QStringLiteral("\">"); QStringLiteral("\">");