Slack Markdown for Links Are Not Resolving

91,522

Solution 1

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

Solution 2

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.

Solution 3

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.

Solution 4

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);

Solution 5

As of August 2021 this feature is finally enabled for markup mode in slack app. https://slack.com/intl/en-nl/help/articles/202288908-Format-your-messages#markup

Surround text with brackets, then surround the link with parentheses:
[your text](the link)
Share:
91,522

Related videos on Youtube

PositiveGuy
Author by

PositiveGuy

I'm so nice, sometimes people slap me and tell me to start being mean :).

Updated on March 17, 2022

Comments

  • PositiveGuy
    PositiveGuy about 2 years

    What am I doing wrong? None of the example Markdown links work so far in my Slack app.

    I pasted in the example below in a chat in my Slack app. I got this example from slack markdown syntax and it still treats it as literal text in the Slack App:

    [like this](http://someurl)
    

    so I end up seeing that instead of just "like this" as a link in Slack chat.

    Or maybe the above is wrong, in which case my question would then be how do you do explicitly create links in Slack? I want some text that I specify to be clickable to a specific URL (hyperlink).

    • Petr Gazarov
      Petr Gazarov about 8 years
      Seems to be unresolved bug (doesn't work for me either) github.com/slackhq/hubot-slack/issues/114
    • pkaramol
      pkaramol over 6 years
      not only the are not implementing this functionality, they also do not include a dark theme! this is outrageous for such a popular tool..on the other hand this is how popular tools become unpopular all of the sudden ...
    • eemz
      eemz about 3 years
      Slack markdown link syntax is <http://someurl|like this> not the same as github. I think you are right that some of the Slack examples used to have that mistake in them, but github syntax does not work.
  • Chris Miller
    Chris Miller almost 8 years
    is there a way to do this via the Slack client?
  • Wilhelm Klopp
    Wilhelm Klopp almost 8 years
    I don't think so. Slack explicitly does not want to overcomplicate input. More at the bottom of this help article: get.slack.help/hc/en-us/articles/…
  • Raja
    Raja over 7 years
    One way they could have avoided overcomplication would have been to stick with a popular and well-established format ... like Markdown. ;-)
  • Peter R
    Peter R about 7 years
    +joeytwiddle That would mean Slack intentionally doing something that is user friendly and intuitive, which I'm pretty sure is against their company policy.
  • spencer.sm
    spencer.sm almost 7 years
    The question is specifically about the slack-api which does support hyperlinked text.
  • Bruce Sun
    Bruce Sun over 6 years
    @PeterR It's pretty disappointing that slack doesn't FULLY support markdown in messages like gitter.im.
  • Jules Sam. Randolph
    Jules Sam. Randolph over 6 years
    Please upvote this feature request here : slack.canny.io/feature-requests/p/…
  • Jasper
    Jasper about 6 years
    Calling this a flavor of markdown is misleading. It's really more "their own formatting that sometimes looks a bit like markdown".
  • superarts.org
    superarts.org about 5 years
    This is unfortunate. Hyperlink has been around for more than 20 years, it's hard to assume this is a security issue. Pasting super long links is really annoying, at least slack should add an automatic URL shortening service (which would be optional of course).
  • TJ Zimmerman
    TJ Zimmerman almost 5 years
    It seems this is now possible. But I'm unable to get it to work. No matter what I do Slack just receives Array as the message in the channel. See the examples here: api.slack.com/messaging/composing/formatting#linking-urls
  • ocramot
    ocramot over 4 years
    Sorry, broken link :(
  • Jules Sam. Randolph
    Jules Sam. Randolph over 4 years
    They seem to have disabled their canny channel to gather feature requests. Hope that is only temporary.
  • Shreyan Mehta
    Shreyan Mehta over 4 years
    you could also use this for email like <mailto:[email protected]|Alice>
  • Pedro77
    Pedro77 over 4 years
    @JulesRandolph link is broken
  • Rahul Chopra
    Rahul Chopra over 4 years
    Today was the nth (where n>10) time that I wrote a [title](url) link in the Slack client, spent a minute trying to figure out if I had a typo somewhere, reversed the order of () and [], and then googled the syntax just to find this answer. How is this less complicated?
  • Tyler James Young
    Tyler James Young about 4 years
    Upvoted because this is essentially the answer. Love the paste-to-linkify, love the hotkey... unfortunately I have disabled their WYSIWYG so that it stops messing with other things I'm trying to write, and there doesn't seem to be any alternative for those of us happy using markdown(-ish) formatting in plain text.
  • rmharrison
    rmharrison almost 4 years
    The link isn't broken. They intentionally disabled the board. Grr.
  • frakman1
    frakman1 almost 4 years
    @Tyler. I'm glad I'm not the only one that does this too!
  • tennabey
    tennabey almost 4 years
    I managed to make it work without the fragment comments
  • Mike T
    Mike T over 3 years
    The original question asks about achieving this using markdown. This answer seems unrelated.
  • Roberto
    Roberto about 3 years
    Worth mentioned that none of these work if you select Format messages with markup in the settings, to get rid of the text formatting toolbar.
  • msw1520
    msw1520 almost 3 years
    This is useful information but it does not answer the question, which is specifically about using Markdown. Much confusion here, since there's the slack WSIWYG editor, there's slack markdown in the client, and then there's markdown in the slack API. I think the original question is about markdown in the client (at least that's what I'm wanting to do). Apparently it is not possible, and Slack has disabled feature requests.
  • törzsmókus
    törzsmókus over 2 years
    I rather hate the hotkey, Ctrl+Shift+U has been used for unicode character input on Linux (ibus input method) for decades
  • timblaktu
    timblaktu over 2 years
    My slack has the link tool, but I'd really love to just do it with the markdown [text](url) like [their docs say should work[(slack.com/help/articles/202288908-Format-your-messages‌​).
  • JackLeEmmerdeur
    JackLeEmmerdeur over 2 years
    This is the only solution for now. Markdown for some stuff works in slack, but links don't. Thx Kev.
  • GokcenG
    GokcenG over 2 years
    It's not great in terms of usability that those are "exclusive".
  • demiurg
    demiurg over 2 years
    Is there a JavaScript equivalent using navigator.clipboard.write ?
  • Araxia
    Araxia almost 2 years
    Confirmed that [label](link) does now work in the Slack app, but FYI this is no longer documented on the page referenced in this answer.
  • 9-Pin
    9-Pin almost 2 years
    Thank you! You have made my day, month, year, and century.
  • Ben M
    Ben M almost 2 years
    but, at least on the mac app, this only works if you disable the WYSIWYG editor. unclear why they force seemingly unnecessary tradeoffs across either editor.
  • SineSwiper
    SineSwiper almost 2 years
    FYI, this still doesn't work in the API. Links still have to be in the older <L|T> format.