ui: connect when a SimpleX link is pasted as a markdown hyperlink

This commit is contained in:
Narasimha-sc
2026-08-05 16:08:00 +00:00
parent 970ef89325
commit dfd51b4e9a
3 changed files with 41 additions and 3 deletions
@@ -836,7 +836,10 @@ fun strConnectTarget(str: String): ConnectTarget? {
val links = parsedMd.filter { it.format?.isSimplexLink ?: false }
if (links.size == 1) {
val fmt = links[0].format as Format.SimplexLink
return ConnectTarget.Link(links[0].text, fmt.linkType, fmt.simplexLinkText)
// showText is set only for a link written as a markdown hyperlink, whose text is the whole
// "[label](link)" source rather than the link - connect via the parsed uri in that case
val text = if (fmt.showText != null) fmt.simplexUri else links[0].text
return ConnectTarget.Link(text, fmt.linkType, fmt.simplexLinkText)
}
if (links.isEmpty()) {
val nameFt = parsedMd.firstOrNull { it.format is Format.SimplexName }