How to escape the (hash) # sign in a Github markdown header? (backslash is not working)

GithubMarkdown

Github Problem Overview


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:

Not good

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.

Github Solutions


Solution 1 - Github

You could try and add a matching '#', followed by one extra '#':

### C# #

Solution 2 - Github

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 ​.

Solution 3 - Github

Add an extra space after ### C\#. See the demo.

Attributions

All content for this solution is sourced from the original question on Stackoverflow.

The content on this page is licensed under the Attribution-ShareAlike 4.0 International (CC BY-SA 4.0) license.

Content TypeOriginal AuthorOriginal Content on Stackoverflow
QuestionifmaView Question on Stackoverflow
Solution 1 - GithubVonCView Answer on Stackoverflow
Solution 2 - GithubshimView Answer on Stackoverflow
Solution 3 - GithubTagir ValeevView Answer on Stackoverflow