How to use angle brackets in URL on Github Flavored Markdown?

血红的双手。 提交于 2019-12-19 10:19:07

问题


I want to use angle brackets in URL on Github Flavor Markdown.

Markdown:

1. Fork it ( http://github.com/<my-github-username>/oooooaaaa/fork )

Expect:

<li>Fork it ( <a href="http://github.com/">http://github.com/&lt;my-github-username&gt;/oooooaaaa/fork</a> )</li>

Actual:

<li>Fork it ( <a href="http://github.com/">http://github.com/</a><my-github-username>/oooooaaaa/fork )</my-github-username></li>

回答1:


Since the angle brackets < and > cannot easily be used (or escaped or encoded) in GitHub Flavored Markdown, one workaround would be to used square brackets:

http://github.com/[my-github-username]/oooooaaaa/fork

That does give the expected result:

a href="http://github.com/">http://github.com/[my-github-username]/oooooaaaa/fork</a>



回答2:


Even this example below works as expected.

http://github.com/(my-github-username)/oooooaaaa/fork




回答3:


Using backslash inside a ()[] construction seems to work. (Tested on GitHub now.) It does not work on SO though.. For example:

1. Fork it ( [http://github.com/\<my-github-username\>/oooooaaaa/fork](http://github.com/\<my-github-username\>/oooooaaaa/fork) )


来源:https://stackoverflow.com/questions/20610244/how-to-use-angle-brackets-in-url-on-github-flavored-markdown

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