Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How do I add a trailing # (hash) to a header in GitHub flavored markdown?

I have a README.md markdown file that I use to describe a project that is hosted on GitHub. Within this file I have several headlines and sub-headlines, each starting with one or more hashes, as usual in markdown.

Now I want to set the text of one headline to C#, but GitHub does not respect the hash a part of the text, but interprets it as an (optional) closing hash for the headline.

Even if I escape the hash by prefixing it with a backslash, it does not work. So if I type

## C#

I get:

C

If I use

## C\#

I get:

C\

How do I write this head-line in a correct way?

like image 808
Golo Roden Avatar asked Nov 24 '12 02:11

Golo Roden


1 Answers

Method 1

You could use a true sharp sign, , instead of the hash sign, #. From the Wikipedia page on C♯:

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

Here ## C♯ produces

C♯

Method 2

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

C#

Note that Pandoc seems to handle # C\# correctly (try it).

like image 151
Chris Avatar answered Oct 05 '22 22:10

Chris