From 6b673d9154cd596b9c648b130f334c166af36875 Mon Sep 17 00:00:00 2001 From: John Preston Date: Fri, 27 Dec 2019 13:40:36 +0300 Subject: [PATCH] Skip internal: links in String::toText with entities. --- ui/text/text.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/ui/text/text.cpp b/ui/text/text.cpp index e984353..e395f5e 100644 --- a/ui/text/text.cpp +++ b/ui/text/text.cpp @@ -3267,14 +3267,16 @@ TextForMimeData String::toText( if (!composeExpanded && !composeEntities) { return; } + const auto skipLink = (entity.type == EntityType::CustomUrl) + && (entity.data.startsWith(qstr("internal:"))); if (composeExpanded) { result.expanded.append(full); - if (entity.type == EntityType::CustomUrl) { + if (entity.type == EntityType::CustomUrl && !skipLink) { const auto &url = entity.data; result.expanded.append(qstr(" (")).append(url).append(')'); } } - if (composeEntities) { + if (composeEntities && !skipLink) { insertEntity({ entity.type, linkStart,