0

I'm writing a README.md file on GitHub. In my project explanation I would like to refer to a Windows user path, in particular:

C:\Users\<username>\AppData\Local

I just see here on SO that the formatting is working fine. On Github, instead, that row is shown like this:

C:\Users<username>\AppData\Local\

even if the md file contains the correct format. It seems that the \ and the < are (due to some rule I don't know) simply converted into <.

Do you have any clue why is happening?

ABCplus
  • 3,981
  • 3
  • 27
  • 43
  • Possible duplicate of [How to use angle brackets in URL on Github Flavored Markdown?](http://stackoverflow.com/questions/20610244/how-to-use-angle-brackets-in-url-on-github-flavored-markdown) – Waylan Apr 27 '17 at 12:51
  • While not technically a duplicate, you might find a better answer here: [< has special meaning in markdown?](http://stackoverflow.com/q/36635226/866026). – Waylan Apr 27 '17 at 12:53
  • @Waylan: first proposed link is for forward slash combined with minus, I would like back slash and minus instead – ABCplus Apr 27 '17 at 13:20
  • If you put your URL in a code span or block as is suggested in the second link above, you won't have the problem. In fact, some would argue that all URLs to be displayed as text should be in code spans/blocks. – Waylan Apr 27 '17 at 22:55

1 Answers1

0

Markdown allowd HTML entities in it, so '<' is &lt;, '\' is e.g. &#92; (also \\ works for me on GitHub) and '>' is &gt; etc.; search for HTML special characters if you need more. you can encode verything in UTF8 easily by the notation with &#dddd; where d stands for a digit.

unfortunately often in code segments or other interpreters it is different.

examples working in GitHub editor with preview:

C:\\Users\\\<username\>\\AppData\\Local

C:\\Users\\&lt;username&gt;\\AppData\\Local

C:&#92;Users&#92;&lt;username&gt;&#92;AppData&#92;Local

all result to the same output.

vv01f
  • 362
  • 1
  • 4
  • 21