Always make custom emoji most-inner tag.
This commit is contained in:
parent
835ba51f5e
commit
d7f12b083e
1 changed files with 12 additions and 8 deletions
|
|
@ -2111,14 +2111,11 @@ EntitiesInText ConvertTextTagsToEntities(const TextWithTags::Tags &tags) {
|
||||||
closeType(type);
|
closeType(type);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (linkChanged && !nextState.link.isEmpty()) {
|
const auto openLink = linkChanged && !nextState.link.isEmpty();
|
||||||
if (Ui::InputField::IsCustomEmojiLink(nextState.link)) {
|
const auto openCustomEmoji = openLink
|
||||||
const auto data = Ui::InputField::CustomEmojiEntityData(
|
&& Ui::InputField::IsCustomEmojiLink(nextState.link);
|
||||||
nextState.link);
|
if (openLink && !openCustomEmoji) {
|
||||||
if (!data.isEmpty()) {
|
if (IsMentionLink(nextState.link)) {
|
||||||
openType(EntityType::CustomEmoji, data);
|
|
||||||
}
|
|
||||||
} else if (IsMentionLink(nextState.link)) {
|
|
||||||
const auto data = MentionEntityData(nextState.link);
|
const auto data = MentionEntityData(nextState.link);
|
||||||
if (!data.isEmpty()) {
|
if (!data.isEmpty()) {
|
||||||
openType(EntityType::MentionName, data);
|
openType(EntityType::MentionName, data);
|
||||||
|
|
@ -2132,6 +2129,13 @@ EntitiesInText ConvertTextTagsToEntities(const TextWithTags::Tags &tags) {
|
||||||
openType(type, nextState.language);
|
openType(type, nextState.language);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
if (openCustomEmoji) {
|
||||||
|
const auto data = Ui::InputField::CustomEmojiEntityData(
|
||||||
|
nextState.link);
|
||||||
|
if (!data.isEmpty()) {
|
||||||
|
openType(EntityType::CustomEmoji, data);
|
||||||
|
}
|
||||||
|
}
|
||||||
state = nextState;
|
state = nextState;
|
||||||
};
|
};
|
||||||
const auto stateForTag = [&](const QString &tag) {
|
const auto stateForTag = [&](const QString &tag) {
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue