user4765675
user4765675

Reputation:

Markdown Heading with HTML as text on Github

When writing my markdown README.md file I want to have the HTML element tag <p> as the heading using two ## for a h2 look. but it will not display the tag. Is there a certain form of syntax I need to use in order for it to be displayed as text and not interpreted as an HTML element. Can someone link me to a Github repo as an example.

Code currently using (does not display on Github):

## <p>

Upvotes: 2

Views: 62

Answers (1)

Maximillian Laumeister
Maximillian Laumeister

Reputation: 20378

The angle brackets need to be encoded as character entities so that they are not interpreted as Markdown or HTML.

I tested the following in a gist on GitHub and it works:

## &lt;p&gt;

It also works as inline Markdown on Stack Overflow (click "edit" to see the Markdown source for my post):

<p>

Upvotes: 2

Related Questions