question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

[Rendering] Needing the ability to manipulate a URL in the markdown hyperlink

See original GitHub issue

Target Platform

Please list the platform(s) that your application is targeting and remove platforms you are not targeting:

  • Microsoft Search

Target Application

Search Layout Designer

Problem Description

When presented with a url in a Microsoft Search result that came from a fileshare Graph Connector, the URL comes into the card in the form of:

\searchserver\Share\department\legal\project\DrawingsSpecifications.xlsx

However, the URL in order to be clickable in a browser needs to be manipulated to some other form, namely:

ms-excel:ofv|u|file:/accessserver/Share/department/legal/project/DrawingsSpecifications.xlsx

That can be performed using the following function:

${concat(\"ms-excel:ofv|u|file:/\",replace(replace(url,'\\\\','/'),'searchserver','accessserver'))}

However that doesn’t seem to be able to be used within a markdown link expression in a textbox.

Card JSON

{
    "type": "AdaptiveCard",
    "version": "1.3",
    "body": [
        {
            "type": "ColumnSet",
            "columns": [
                {
                    "type": "Column",
                    "width": "auto",
                    "items": [
                        {
                            "type": "Image",
                            "url": "https://img.icons8.com/color/452/microsoft-excel-2019--v1.png",
                            "altText": "Thumbnail image",
                            "horizontalAlignment": "Center",
                            "size": "Small",
                            "isVisible": false
                        }
                    ],
                    "horizontalAlignment": "Center"
                },
                {
                    "type": "Column",
                    "width": 10,
                    "items": [
                        {
                            "type": "TextBlock",
                            "text": "[${$root.title}](${concat(\"ms-excel:ofv|u|file:/\",replace(replace(url,'\\\\','/'),'searchserver','accessserver'))})",
                            "weight": "Bolder",
                            "color": "Accent",
                            "size": "Medium",
                            "$when": "",
                            "maxLines": 2,
                            "wrap": true
                        },
                        {
                            "type": "TextBlock",
                            "text": "${concat(\"ms-excel:ofv|u|file:/\",replace(replace(url,'\\\\','/'),'searchserver','accessserver'))}",
                            "spacing": "Small",
                            "$when": "",
                            "maxLines": 3
                        },
                        {
                            "type": "ColumnSet",
                            "columns": [
                                {
                                    "type": "Column",
                                    "width": "stretch",
                                    "items": [
                                        {
                                            "type": "TextBlock",
                                            "text": "${$root.lastModifiedBy}",
                                            "color": "Accent",
                                            "size": "Medium",
                                            "$when": "",
                                            "maxLines": 3,
                                            "weight": "Bolder"
                                        },
                                        {
                                            "type": "TextBlock",
                                            "text": "${$root.modifiedDateTime}",
                                            "spacing": "Small",
                                            "$when": "",
                                            "weight": "Bolder",
                                            "maxLines": 3
                                        }
                                    ],
                                    "$when": ""
                                },
                                {
                                    "type": "Column",
                                    "width": "stretch",
                                    "items": [
                                        {
                                            "type": "TextBlock",
                                            "text": "${$root.createdBy}",
                                            "color": "Accent",
                                            "size": "Medium",
                                            "weight": "Bolder",
                                            "$when": "",
                                            "maxLines": 3
                                        },
                                        {
                                            "type": "TextBlock",
                                            "text": "${$root.createdDateTime}",
                                            "spacing": "Small",
                                            "$when": "",
                                            "weight": "Bolder",
                                            "maxLines": 3
                                        }
                                    ],
                                    "$when": "",
                                    "spacing": "Large"
                                },
                                {
                                    "type": "Column",
                                    "width": "stretch",
                                    "items": [
                                        {
                                            "type": "TextBlock",
                                            "text": "Extension",
                                            "color": "Accent",
                                            "size": "Medium",
                                            "weight": "Bolder",
                                            "$when": "",
                                            "maxLines": 3
                                        },
                                        {
                                            "type": "TextBlock",
                                            "text": "${$root.extension}",
                                            "spacing": "Small",
                                            "$when": "",
                                            "weight": "Bolder",
                                            "maxLines": 3
                                        }
                                    ],
                                    "$when": "",
                                    "spacing": "Large"
                                }
                            ]
                        }
                    ],
                    "spacing": "Medium"
                }
            ]
        }
    ],
    "$schema": "http://adaptivecards.io/schemas/adaptive-card.json"
}

Version of SDK

What version are you using? Ex: NuGet 1.0.2, or latest main, etc…

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:6 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
HaSambcommented, Jul 14, 2021

Interesting… I also coming across the same issue that MS-Search fileshare links are not clickable/working correctly. Are they already plans when the fix will be implemented?

0reactions
paulcam206commented, Feb 3, 2022

Addressing this issue is not currently on our roadmap, so closing. Please feel free to continue the conversation in this issue for future consideration.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Embedding Links - Markdown Monster Documentation
Embedding Links. about 3 minutes to read. You can embed links into document content in several ways: Using the Link Dialog (ctrl-k) ...
Read more >
Markdown link not being rendered as a hyperlink?
The problem was due to an invisible character in the end of the link URL. Here is the revision history of this answer: ......
Read more >
How do I prevent auto-generated links in the GitHub wiki?
Original answer (2014): This isn't limited to wiki page, and is part of the GFM (GitHub Flavored Markdown) url autolinking feature.
Read more >
Any ideas or existing implementations on markdown link ...
Any ideas or existing implementations on markdown link metadata? - Features - Joplin Forum.
Read more >
Creating Links in Markdown - The AnVIL
Instructions on how to create links in AnVIL markdown. ... The square brackets hold the text, the parentheses hold the link.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found