GitHub Flavored Markdown: A Quick Overview.

GitHub uses the “GitHub Flavored Markdown” (GFM) for messages, issues, and comments.

It differs from “Standard Markdown” (SM) in a few significant ways and adds some additional functionality.

Differences from traditional Markdown:

Newlines
The biggest difference that GFM introduces is in the handling of linebreaks.
With SM you can hard wrap paragraphs of text and they will be combined into a single paragraph.
We find this to be the cause of a huge number of unintentional formatting errors.
GFM treats newlines in paragraph-like content as real line breaks, which is probably what you intended.

Multiple underscores in words
It is not reasonable to italicize just part of a word, especially when you’re dealing with code and names often appear with multiple underscores.
Therefore, GFM ignores multiple underscores in words.

URL autolinking
GFM will autolink standard URLs, so if you want to link to a URL (instead of setting link text), you can simply enter the URL and it will be turned into a link to that URL.

Fenced code blocks
Markdown converts text with four spaces at the front of each line to code blocks. GFM supports that, but we also support fenced blocks. Just wrap your code blocks in “` and you won’t need to indent manually to trigger a code block.

Syntax highlighting
We take code blocks a step further and add syntax highlighting if you request it.
In your fenced block, add an optional language identifier and we’ll run it through syntax highlighting.
For example, to syntax highlight Ruby code:

```ruby
require 'redcarpet'
markdown = Redcarpet.new("Hello World!")
puts markdown.to_html
```

In addition to the changes in the previous section, certain references are auto-linked:
* SHA: be6a8cc1c1ecfe9489fb51e4869af15a13fc2cd2
* User@SHA ref: mojombo@be6a8cc1c1ecfe9489fb51e4869af15a13fc2cd2
* User/Project@SHA: mojombo/god@be6a8cc1c1ecfe9489fb51e4869af15a13fc2cd2
* \#Num: #1
* User/#Num: mojombo#1
* User/Project#Num: mojombo/god#1

SHA: be6a8cc
User@SHA ref: mojombo@be6a8cc
User/Project@SHA: mojombo/god@be6a8cc
#Num: #1
User/#Num: mojombo#1
User/Project#Num: mojombo/god#1


Comments are closed.