Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Slack Markdown for Links Are Not Resolving

Slack currently does not support hyperlinks; see this link which says:

Note: It’s not possible to hyperlink words in a Slack message.


UPDATE:

Slack has finally added this functionality to their chat interface (source):

  • Select text, then click the link icon in the formatting toolbar
  • Select text, then press Cmd+Shift+U on Mac or Ctrl+Shift+U on Windows/Linux.

Copy the link you'd like to share and paste it in the empty field under Link, then click Save.


Slack uses their own flavor of markdown:
Slack Markdown Links work in the following way: <http://someurl|like this>

Note: You can only do this via the Slack API and NOT just as a simple message you send via the Slack client.

Message Builder Example
enter image description here More Info in the Docs


This is not yet supported by Slack for direct messages, you can only do this using Slack API. But you can upvote the feature request I have submitted here.


As of today, 2020.02.14, in one of the Slack instances I'm a member in, I can create/paste hyperlinks! 🎉

hyperlink screenshot

Example pasting hyperlink from copy Teams meeting info into Slack:

paste hyperlink example


Slack has updated their documentation. Still no markdown way of doing it though 😢, i.e. [blah](https://stackoverflow.com) doesn't work.


Neat feature, select some text and CTRL + V when a URL is on the clipboard and it creates a hyperlink 🥳

select text & ctrl + v video]


Through some reverse engineering I was able to put text on the Windows Clipboard via C# and get it to paste into Slack:

var textToDisplay = "Test";
var url = "https://stackoverflow.com";
var arbitraryText = "Mike D.";
var dataObject = new DataObject();
//to my surprise, the Fragment comments ARE required
dataObject.SetData(DataFormats.Html, @$"<html><body>
    <!--StartFragment-->
    <a href=""{url}"">{textToDisplay}</a>
    <!--EndFragment-->
    </body></html>");
//have to set the Text format too otherwise it won't work
dataObject.SetData(DataFormats.Text, arbitraryText);
Clipboard.SetDataObject(dataObject);

If you are using slack-bot or something that uses Slack API, you'll be able to use mrkdwn syntax for your messages.

<http://www.example.com|This message is a link>

Reference: https://api.slack.com/reference/surfaces/formatting