mirror of
https://github.com/Nheko-Reborn/nheko.git
synced 2024-11-22 19:08:58 +03:00
Make emoji escaping less aggressive
This commit is contained in:
parent
0ebd0b0526
commit
cd08a130c6
1 changed files with 7 additions and 1 deletions
|
@ -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("\">");
|
||||||
|
|
Loading…
Reference in a new issue