fix: clickable timestamps in blockquote

This commit is contained in:
cumdev1337
2026-05-22 02:23:20 +03:00
committed by John Preston
parent 9d78cd1a8e
commit ea1ea65f6d
@@ -161,9 +161,13 @@ TextWithEntities AddTimestampLinks(
from,
std::less<>(),
&EntityInText::offset);
const auto allowsTimestampLink = [](const EntityInText &entity) {
return (entity.type() == EntityType::Spoiler)
|| (entity.type() == EntityType::Blockquote);
};
while (i != entities.end()
&& i->offset() < till
&& i->type() == EntityType::Spoiler) {
&& allowsTimestampLink(*i)) {
++i;
}
if (i != entities.end() && i->offset() < till) {
@@ -172,7 +176,7 @@ TextWithEntities AddTimestampLinks(
const auto intersects = [&](const EntityInText &entity) {
return (entity.offset() + entity.length() > from)
&& (entity.type() != EntityType::Spoiler);
&& !allowsTimestampLink(entity);
};
auto j = std::make_reverse_iterator(i);
const auto e = std::make_reverse_iterator(entities.begin());