---
layout: default
title: Configuring Redcarpet
---
# Configuring Redcarpet
GitHub uses the [Redcarpet](https://github.com/vmg/redcarpet/) renderer for `.md` content.
Jekyll supports various Markdown renderers and each has their own configuration settings. These settings are somewhat confusingly called "extensions".
The extensions for Redcarpet are documented in the "[simple to use](https://github.com/vmg/redcarpet#and-its-like-really-simple-to-use)" section of the main Redcarpet README.
Jekyll also adds a number of Jekyll specific Redcarpet extensions which are documented in the [Redcarpet section](http://jekyllrb.com/docs/configuration/#redcarpet) of the Jekyll configuration page.
In your `_config.yml` you can set the various extensions you want for a specific renderer, e.g. like so for Redcarpet:
```YAML
redcarpet:
extensions: ["no_intra_emphasis", "tables", "autolink", "strikethrough", "with_toc_data"]
```
Let's look at all these Redcarpet extensions, both the standard ones and the Jekyll specific ones, and look at if they're used by GitHub for `.md` content.
## Standard Redcarpet extensions
### no_intra_emphasis
Set by GitHub - without it the `_` character within words would turn on emphasis so foo_bar would render as foobar, i.e. without the underscore and with the "bar" part in italics.
### tables
Set by GitHub - without it the following would not be rendered as a table.
| Tables | Are | Cool |
| ------------- |:-------------:| -----:|
| col 3 is | right-aligned | $1600 |
| col 2 is | centered | $12 |
| zebra stripes | are neat | $1 |
### fenced_code_blocks
Standard Markdown supports code blocks, with no special highlighting, that are created by indenting each line by four spaces.
With `fenced_code_blocks` code blocks can be fenced by three backticks with an optional language name from [languages.yml](https://github.com/github/linguist/blob/master/lib/linguist/languages.yml).
```javascript
var s = "JavaScript syntax highlighting";
alert(s);
```
```javascript
var s = "JavaScript syntax highlighting";
alert(s);
```
`fenced_code_blocks` is enabled by default by Jekyll and so doesn't need to be set explicitly for GitHub-like behavior.
### autolink
Set by GitHub - without it the following would not automatically be handled as links and you'd need to use `[foo@...](mailto:foo@...)` etc.
foo@bar.com
www.example.com
http://www.example.com/
### disable_indented_code_blocks
Not set by GitHub - if it were you couldn't use the traditional Markdown approach of creating code block by indenting them by four spaces.
This is a code block created by indenting each line by four spaces.
As in fenced code blocks you don't have to worry about e.g. being interpreted.
### strikethrough
Set by GitHub - with this enabled you can strikethrough text with two `~` characters at the start and end.
~~strikethrough~~
### lax_spacing
Enabled by default by Jekyll and so doesn't need to be set explicitly for GitHub-like behavior.
In traditional Markdown any HTML has to be bounded by empty lines in order to be interpreted as HTML.
Without this the HTML creating the single cell table seen here would not be handled as HTML as it is surrounded by non-empty lines.
A non-empty line before the HTML.
A non-empty line after the HTML.
### space_after_headers
Enabled by default by Jekyll and so doesn't need to be set explicitly for GitHub-like behavior.
In traditional Markdown a `#` must be followed by a space to be interpreted as a header.
So `# some text` would be interpreted as a header but `#some text` would not. For GitHub both are fine.
##### With a space h5-header
#####Without a space h5-header
### superscript
Not set by GitHub. If it were the `^` character could be used to create superscripts like so `2^4` or `2^(nd)`.
### underline
Not set by GitHub. If it were you could underline words with `_` but as it is both `_` and `*` result in italics.
I.e. `_foobar_` and `*foobar*` both result in *foobar*.
### highlight
Not set by GitHub. If it were then ==highlighted== would appear as highlighted.
### quote
Not set by GitHub. If it were then "quote" would appear as quote
. See also the more sophisticated `smart` extension below.
### footnotes
Not set by GitHub. If it were you could create footnotes like so:
Here is some text containing a footnote.[^somesamplefootnote]
[^somesamplefootnote]: Here is the text of the footnote itself.
### with_toc_data
Set by GitHub. Without this headers would not automatically have HTML anchors that can be linked to from elsewhere.
##### Link to me
To jump to this header you just need to do `[link](#link-to-me)` - which results in "[link](#link-to-me)".
See the separate "[Hover anchors](#hover-anchors)" section for more details.
### hard_wrap
Set by GitHub in some situations and not in others - see the separate "[Hard wrap](#hard-wrap)" section for more details.
### xhtml
Not set by GitHub. If it were XHTML-conformant tags would be output, e.g. `
` would be output as `
`.
### prettify
Not set by GitHub. If it were the class `prettyprint` would be added to `code` tags so that you could use [google-code-prettify](https://code.google.com/p/google-code-prettify/wiki/GettingStarted). Note: this affects both inline code, i.e. text surrounded by backticks, and code blocks. If using this extension one should probably disable fenced code blocks which are handled with the [Pygments](http://pygments.org/) highlighting system.
### link_attributes
Not set by GitHub. It can be used to add attributes like `target="_blank"` or `rel="nofollow"` to all links. Note: the extensions sub-setting in `_config.yml` cannot be used for this extension as it only supports [extensions that can be set to true](http://jekyllrb.com/docs/configuration/#redcarpet).
## Safe HTML extensions
In addition to the extensions already covered there are a number of standard extensions related to constraining the use of HTML in Markdown.
GitHub is fairly lenient in this respect and the following restrictive extensions are _not_ set by GitHub:
* `filter_html`
* `no_images`
* `no_links`
* `escape_html`
The following two extensions, `no_styles` and `safe_links_only` are set by GitHub. However for your own pages it presumably doesn't make sense to restrict your own use of `