Make emoji escaping less aggressive

pull/1186/head
Nicolas Werner 2 years ago
parent 0ebd0b0526
commit cd08a130c6
No known key found for this signature in database
GPG Key ID: C8D75E610773F2D9
  1. 8
      src/Utils.cpp

@ -131,8 +131,14 @@ utils::replaceEmoji(const QString &body)
QVector<uint> utf32_string = body.toUcs4();
bool insideFontBlock = false;
bool insideTag = false;
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) {
fmtBody += QStringLiteral("<font face=\"") % UserSettings::instance()->emojiFont() %
QStringLiteral("\">");

Loading…
Cancel
Save