Is there a syntax for links with no text in Markdown?

旧时模样 提交于 2019-12-06 17:02:44

问题


I want to write

http://www.foo.com/ 

and get a link with the URL as the text (e.g., in HTML output). I do not want to write

[http://www.foo.com/](http://www.foo.com/)

Is it possible?


回答1:


Yes, here is the relevant section of the documentation:

AUTOMATIC LINKS

Markdown supports a shortcut style for creating “automatic” links for URLs and email addresses: simply surround the URL or email address with angle brackets. What this means is that if you want to show the actual text of a URL or email address, and also have it be a clickable link, you can do this:

<http://example.com/>

Markdown will turn this into:

<a href="http://example.com/">http://example.com/</a>



回答2:


I find this works with my IDE nicely, wrapping the link in an <a> tag:

<a>http://example.com/</a>


来源:https://stackoverflow.com/questions/24887301/is-there-a-syntax-for-links-with-no-text-in-markdown

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!