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);
|
||||
}
|
||||
}
|
||||
if (linkChanged && !nextState.link.isEmpty()) {
|
||||
if (Ui::InputField::IsCustomEmojiLink(nextState.link)) {
|
||||
const auto data = Ui::InputField::CustomEmojiEntityData(
|
||||
nextState.link);
|
||||
if (!data.isEmpty()) {
|
||||
openType(EntityType::CustomEmoji, data);
|
||||
}
|
||||
} else if (IsMentionLink(nextState.link)) {
|
||||
const auto openLink = linkChanged && !nextState.link.isEmpty();
|
||||
const auto openCustomEmoji = openLink
|
||||
&& Ui::InputField::IsCustomEmojiLink(nextState.link);
|
||||
if (openLink && !openCustomEmoji) {
|
||||
if (IsMentionLink(nextState.link)) {
|
||||
const auto data = MentionEntityData(nextState.link);
|
||||
if (!data.isEmpty()) {
|
||||
openType(EntityType::MentionName, data);
|
||||
|
|
@ -2132,6 +2129,13 @@ EntitiesInText ConvertTextTagsToEntities(const TextWithTags::Tags &tags) {
|
|||
openType(type, nextState.language);
|
||||
}
|
||||
}
|
||||
if (openCustomEmoji) {
|
||||
const auto data = Ui::InputField::CustomEmojiEntityData(
|
||||
nextState.link);
|
||||
if (!data.isEmpty()) {
|
||||
openType(EntityType::CustomEmoji, data);
|
||||
}
|
||||
}
|
||||
state = nextState;
|
||||
};
|
||||
const auto stateForTag = [&](const QString &tag) {
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue