I have the following code on a README.md
file on Github, where I am trying to display the hash sign on a header (I am trying to escape it using the \
symbol) like so:
### C\# * [Beginning Game Programming with C#](https://www.coursera.org/course/gameprogramming)
However it renders like so:
I obviously want the hash sign to appear on the header, and I also tried to use a double backslash, but it didn't work. How do I get the pound sign to appear?
EDIT: the linked question deals with github links, my question is to do with headers on a .md
file.
In Markdown, you can escape various characters using a backslash ( \ ), so if you wanted to type C#, you would use C\# .
In a URL, a hash mark, number sign, or pound sign ( # ) points a browser to a specific spot in a page or website. It is used to separate the URI of an object from a fragment identifier. When you use a URL with a # , it doesn't always go to the correct part of the page or website.
The difference between encodeURI and encodeURIComponent is encodeURIComponent encodes the entire string, where encodeURI ignores protocol prefix ('http://') and domain name. encodeURIComponent is designed to encode everything, where encodeURI ignores a URL's domain related roots.
Percent-encoding is a mechanism to encode 8-bit characters that have specific meaning in the context of URLs. It is sometimes called URL encoding. The encoding consists of substitution: A '%' followed by the hexadecimal representation of the ASCII value of the replace character.
You could try and add a matching '#', followed by one extra '#':
### C# #
You can also use #
in place of the # symbol (based on this meta answer).
Or, as in this answer you can insert an invisible character before the octothorp, such as ​
.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With