From 19de16ba6f74b02352af96fe4c15f38bd2e04f32 Mon Sep 17 00:00:00 2001 From: 23rd <23rd@vivaldi.net> Date: Mon, 17 Jan 2022 10:10:14 +0300 Subject: [PATCH] Fixed processing of started entities for monospace. --- ui/text/text.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/ui/text/text.cpp b/ui/text/text.cpp index 24332b7..bec2761 100644 --- a/ui/text/text.cpp +++ b/ui/text/text.cpp @@ -441,6 +441,7 @@ bool Parser::checkEntities() { auto flags = TextBlockFlags(); auto link = EntityLinkData(); + auto monoIndex = 0; const auto entityType = _waitingEntity->type(); const auto entityLength = _waitingEntity->length(); const auto entityBegin = _start + _waitingEntity->offset(); @@ -492,7 +493,7 @@ bool Parser::checkEntities() { if (isSingleLine) { _monos.push_back({ .text = text, .type = entityType }); - _monoIndex = _monos.size(); + monoIndex = _monos.size(); } } else if (entityType == EntityType::Url || entityType == EntityType::Email @@ -525,6 +526,7 @@ bool Parser::checkEntities() { createBlock(); _flags |= flags; _startedEntities[entityEnd].emplace_back(flags); + _monoIndex = monoIndex; } } else if (entityType == EntityType::Spoiler) { createBlock();