kakashinji
kakashinji

Reputation: 3

Failing to render a header on GitHub

Here's my README.md in a GitHub repo:

###This is a Header
This is not a Header

Both lines render as plain text. The first one should render as a Header and I remember it did previously.

I have no idea what's wrong with my browsers (Chrome on macOS), I've tried Firefox and Opera but nothing helps.

Upvotes: 0

Views: 107

Answers (3)

Rahn
Rahn

Reputation: 5425

it's not a problem of your browser. I found the same "bug", too.

GitHub just update their markdown renderer to CommonMark: https://github.com/blog/2333-a-formal-spec-for-github-flavored-markdown

and CommonMark requires that a space character be between the # characters and the title: ### Header

###This is not a Header
### This is a Header

enter image description here

Though most of my MarkDown editor (Typora, MacDown) render them Header:

enter image description here

Upvotes: 4

jonrsharpe
jonrsharpe

Reputation: 122136

Per the new specification, for the ATX-style headings (emphasis mine):

The opening sequence of # characters must be followed by a space or by the end of line.

...

At least one space is required between the # characters and the heading’s contents, unless the heading is empty. Note that many implementations currently do not require the space. However, the space was required by the original ATX implementation...

Upvotes: 0

vishwarajanand
vishwarajanand

Reputation: 1071

Put a space after #. It seems that's necessary.

Upvotes: 0

Related Questions