> Not all of the GitLab-specific extensions to Markdown that are described in this document currently work on our documentation website.
>
> For the best result, we encourage you to check this document out as rendered by GitLab: [markdown.md](https://gitlab.com/gitlab-org/gitlab-ce/blob/master/doc/markdown/markdown.md).
Not all of the GitLab-specific extensions to Markdown that are described in
this document currently work on our documentation website.
>
For the best result, we encourage you to check this document out as rendered
by GitLab: [markdown.md]
_GitLab uses the [Redcarpet Ruby library][redcarpet] for Markdown processing._
_GitLab uses the [Redcarpet Ruby library][redcarpet] for Markdown processing._
GitLab uses "GitLab Flavored Markdown" (GFM). It extends the standard Markdown in a few significant ways to add some useful functionality. It was inspired by [GitHub Flavored Markdown](https://help.github.com/articles/basic-writing-and-formatting-syntax/).
GitLab uses "GitLab Flavored Markdown" (GFM). It extends the standard Markdown in a few significant ways to add some useful functionality. It was inspired by [GitHub Flavored Markdown](https://help.github.com/articles/basic-writing-and-formatting-syntax/).
You can use GFM in
You can use GFM in the following areas:
- comments
- comments
- issues
- issues
- merge requests
- merge requests
- milestones
- milestones
- snippets (the snippet must be named with a `.md` extension)
- wiki pages
- wiki pages
- markdown documents inside the repository
You can also use other rich text files in GitLab. You might have to install a dependency to do so. Please see the [github-markup gem readme](https://github.com/gitlabhq/markup#markups) for more information.
You can also use other rich text files in GitLab. You might have to install a
dependency to do so. Please see the [github-markup gem readme](https://github.com/gitlabhq/markup#markups) for more information.
GFM honors the markdown specification in how [paragraphs and line breaks are handled](https://daringfireball.net/projects/markdown/syntax#p).
GFM honors the markdown specification in how [paragraphs and line breaks are handled](https://daringfireball.net/projects/markdown/syntax#p).
A paragraph is simply one or more consecutive lines of text, separated by one or more blank lines.
A paragraph is simply one or more consecutive lines of text, separated by one or more blank lines.
Line-breaks, or softreturns, are rendered if you end a line with two or more spaces
Line-breaks, or softreturns, are rendered if you end a line with two or more spaces:
Roses are red [followed by two or more spaces]
Roses are red [followed by two or more spaces]
Violets are blue
Violets are blue
...
@@ -70,17 +78,25 @@ Sugar is sweet
...
@@ -70,17 +78,25 @@ Sugar is sweet
## Multiple underscores in words
## Multiple underscores in words
It is not reasonable to italicize just _part_ of a word, especially when you're dealing with code and names that often appear with multiple underscores. Therefore, GFM ignores multiple underscores in words.
It is not reasonable to italicize just _part_ of a word, especially when you're dealing with code and names that often appear with multiple underscores. Therefore, GFM ignores multiple underscores in words:
perform_complicated_task
perform_complicated_task
do_this_and_do_that_and_another_thing
do_this_and_do_that_and_another_thing
perform_complicated_task
perform_complicated_task
do_this_and_do_that_and_another_thing
do_this_and_do_that_and_another_thing
## URL auto-linking
## URL auto-linking
GFM will autolink almost any URL you copy and paste into your text.
_GitLab uses the [Rouge Ruby library][rouge] for syntax highlighting. For a
_GitLab uses the [Rouge Ruby library][rouge] for syntax highlighting. For a
list of supported languages visit the Rouge website._
list of supported languages visit the Rouge website._
Blocks of code are either fenced by lines with three back-ticks <code>```</code>, or are indented with four spaces. Only the fenced code blocks support syntax highlighting.
Blocks of code are either fenced by lines with three back-ticks <code>```</code>,
or are indented with four spaces. Only the fenced code blocks support syntax
highlighting:
```no-highlight
```no-highlight
Inline `code` has `back-ticks around` it.
Inline `code` has `back-ticks around` it.
...
@@ -194,6 +218,9 @@ But let's throw in a <b>tag</b>.
...
@@ -194,6 +218,9 @@ But let's throw in a <b>tag</b>.
Image tags with a video extension are automatically converted to a video player.
Image tags with a video extension are automatically converted to a video player.
The valid video extensions are `.mp4`, `.m4v`, `.mov`, `.webm`, and `.ogv`.
The valid video extensions are `.mp4`, `.m4v`, `.mov`, `.webm`, and `.ogv`.
...
@@ -604,7 +640,7 @@ This line is separated from the one above by two newlines, so it will be a *sepa
...
@@ -604,7 +640,7 @@ This line is separated from the one above by two newlines, so it will be a *sepa
This line is also a separate paragraph, but...
This line is also a separate paragraph, but...
This line is only separated by a single newline, so it's a separate line in the *same paragraph*.
This line is only separated by a single newline, so it's a separate line in the *same paragraph*.
This line is also a separate paragraph, and...
This line is also a separate paragraph, and...
This line is on its own line, because the previous line ends with two
This line is on its own line, because the previous line ends with two
spaces.
spaces.
```
```
...
@@ -616,7 +652,7 @@ This line is separated from the one above by two newlines, so it will be a *sepa
...
@@ -616,7 +652,7 @@ This line is separated from the one above by two newlines, so it will be a *sepa
This line is also begins a separate paragraph, but...
This line is also begins a separate paragraph, but...
This line is only separated by a single newline, so it's a separate line in the *same paragraph*.
This line is only separated by a single newline, so it's a separate line in the *same paragraph*.
This line is also a separate paragraph, and...
This line is also a separate paragraph, and...
This line is on its own line, because the previous line ends with two
This line is on its own line, because the previous line ends with two
spaces.
spaces.
...
@@ -662,6 +698,7 @@ By including colons in the header row, you can align the text within that column
...
@@ -662,6 +698,7 @@ By including colons in the header row, you can align the text within that column
- The [Markdown Syntax Guide](https://daringfireball.net/projects/markdown/syntax) at Daring Fireball is an excellent resource for a detailed explanation of standard markdown.
- The [Markdown Syntax Guide](https://daringfireball.net/projects/markdown/syntax) at Daring Fireball is an excellent resource for a detailed explanation of standard markdown.
-[Dillinger.io](http://dillinger.io) is a handy tool for testing standard markdown.
-[Dillinger.io](http://dillinger.io) is a handy tool for testing standard markdown.