Skip to content

Instantly share code, notes, and snippets.

@michaelhood
Last active December 11, 2015 01:19
Show Gist options
  • Save michaelhood/4522989 to your computer and use it in GitHub Desktop.
Save michaelhood/4522989 to your computer and use it in GitHub Desktop.
GFM has undocumented difference in hN parsing

GFM requires space between # and string to create an hN.

% curl -d '{"text": "#asdf", "mode": "gfm"}' https://api.github.com/markdown
<p>#asdf</p>

% curl -d '{"text": "# asdf", "mode": "gfm"}' https://api.github.com/markdown
<h1>asdf</h1>

markdown doesn't.

% curl -d '{"text": "#asdf", "mode": "markdown"}' https://api.github.com/markdown
<h1>
<a name="asdf" class="anchor" href="#asdf"><span class="mini-icon mini-icon-link"></span></a>asdf</h1>

% curl -d '{"text": "# asdf", "mode": "markdown"}' https://api.github.com/markdown
<h1>
<a name="asdf" class="anchor" href="#asdf"><span class="mini-icon mini-icon-link"></span></a>asdf</h1>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment