Skip internal: links in String::toText with entities.
This commit is contained in:
parent
65eb03a6a7
commit
6b673d9154
1 changed files with 4 additions and 2 deletions
|
|
@ -3267,14 +3267,16 @@ TextForMimeData String::toText(
|
||||||
if (!composeExpanded && !composeEntities) {
|
if (!composeExpanded && !composeEntities) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
const auto skipLink = (entity.type == EntityType::CustomUrl)
|
||||||
|
&& (entity.data.startsWith(qstr("internal:")));
|
||||||
if (composeExpanded) {
|
if (composeExpanded) {
|
||||||
result.expanded.append(full);
|
result.expanded.append(full);
|
||||||
if (entity.type == EntityType::CustomUrl) {
|
if (entity.type == EntityType::CustomUrl && !skipLink) {
|
||||||
const auto &url = entity.data;
|
const auto &url = entity.data;
|
||||||
result.expanded.append(qstr(" (")).append(url).append(')');
|
result.expanded.append(qstr(" (")).append(url).append(')');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (composeEntities) {
|
if (composeEntities && !skipLink) {
|
||||||
insertEntity({
|
insertEntity({
|
||||||
entity.type,
|
entity.type,
|
||||||
linkStart,
|
linkStart,
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue