jsarafajr / slackify-markdown

Convert markdown into Slack-specific markdown
MIT License
129 stars 25 forks source link

Prefer alt text in links and images #20

Closed 72636c closed 3 years ago

72636c commented 3 years ago

This looks to overturn a couple of decisions made in slackify-markdown. While I can see arguments both ways, I reckon that the proposed changes are less surprising as default behaviour:

  1. Render an invalid link with its alt text before its URL.

    The URL isn't valid anyway, and the alt text will likely flow better in its sentence.

  2. Label a link with its alt text before its title.

    If we look at how GitHub renders Markdown, the alt text is chosen as the label, and the title corresponds to the HTML attribute of the same name and manifests as a tooltip. We are not afforded a similar attribute with Slack, so the title is only useful as a fallback.


Given this source:

By continuing you agree to our [terms of use](../terms).

Lost? You can always return to our [homepage](https://www.atlassian.com "Atlassian.com").

Current output:

By continuing you agree to our ../terms.

Lost? You can always return to our Atlassian.com.

Proposed output:

By continuing you agree to our terms of use.

Lost? You can always return to our homepage.

jsarafajr commented 3 years ago

I have no objection to this one.

jsarafajr commented 3 years ago

Published in slackify-markdown@v4.1.0