Skip internal: links in String::toText with entities.

This commit is contained in:
John Preston 2019-12-27 13:40:36 +03:00
parent 65eb03a6a7
commit 6b673d9154

View file

@ -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,