0

When I test the GitHub Markdown API (https://developer.github.com/v3/markdown/), I'll get a link inside an h1 tag when converting a simple "# Headline".

This is what I send:

curl --data '{"text":"#Headline","mode":"markdown"}' https://api.github.com/markdown

This is what I get:

<h1> <a id="user-content-headline" class="anchor" href="#headline" aria-hidden="true"><span class="octicon octicon-link"></span></a>Headline</h1>

This is what I expected to get:

<h1>Headline</h1>

Does anyone knows why it happens this way and how to avoid it?

Thanks.

James A Mohler
  • 11,060
  • 15
  • 46
  • 72
MarioHofer
  • 21
  • 5
  • 1
    It's there so you can link directly to the headline. If you don't want your document rendered the way GitHub does it, why are you rendering it with their Markdown service? – ChrisGPT was on strike Mar 04 '15 at 14:42
  • Thanks for the answer. I was wondering why the do it that way. Do you have any markdown service you can recommend? – MarioHofer Mar 13 '15 at 09:24
  • It largely depends on what you're trying to accomplish. The GitHub service is great if you're trying to preview how GitHub will render a file. The [original Markdown implementation](http://daringfireball.net/projects/markdown/) is good enough for many folks who want to render locally, but some other folks want a more powerful implementation like MultiMarkdown or Pandoc. In any case, [tool recommendations are off topic on Stack Overflow](http://stackoverflow.com/help/on-topic). Maybe you could reword your question so it's more objective? – ChrisGPT was on strike Mar 13 '15 at 11:48

1 Answers1

1

You could try setting the mode parameter to gfm (the default is markdown).

https://developer.github.com/v3/markdown/

Stephen Last
  • 5,491
  • 9
  • 44
  • 85