From cd08a130c60c600f043bbe9bc3351e48fa56556c Mon Sep 17 00:00:00 2001 From: Nicolas Werner Date: Fri, 16 Sep 2022 15:17:24 +0200 Subject: [PATCH] Make emoji escaping less aggressive --- src/Utils.cpp | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/Utils.cpp b/src/Utils.cpp index 0e193c43..d0b6818d 100644 --- a/src/Utils.cpp +++ b/src/Utils.cpp @@ -131,8 +131,14 @@ utils::replaceEmoji(const QString &body) QVector 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("emojiFont() % QStringLiteral("\">");