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

5.3k views Asked by At

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>
3

There are 3 answers

1
VonC On BEST ANSWER

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>
0
Adi On

Even this example below works as expected.

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

0
Håkon Hægland On

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