How to add a final # (hash) to the header in a GitHub markdown?

I have a README.md markdown file that I use to describe a project hosted on GitHub. Inside this file, I have several headers and subheadings, each of which begins with one or more hashes, as usual, in markdowns.

Now I want the text of one header to be C# , but GitHub does not consider the hash to be part of the text, but interprets it as a (optional) closing hash for the header.

Even if I leave the hash, prefixing it with a backslash, this will not work. Therefore, if I type

 ## C# 

I get:

 C 

If i use

 ## C\# 

I get:

 C\ 

How to write this header line correctly?

+6
source share
1 answer

Method 1

You can use the true sharp sign instead of the hash sign # . On the Wikipedia page on C♯:

By convention, the hash character is used for the second character in the plain text; in artistic representations, a true sharp sign is sometimes used: C♯.

Here ## C♯ creates

C♯

Method 2

Alternatively (at least on this site) just put a space after the last # , for example ## C\# creates

FROM#

Note that Pandoc correctly handles # C\# ( try ).

+7
source

All Articles