docs/available-options.md
!!! warning ""
Starting from the version 1.6.0 and earlier, all the options are disabled by default in the cli tool.
Support escaping of HTML tags.
booleanfalse1.7.2=== "input"
```html
\<div>foo\</div>
```
=== "output (value is true)"
```html
<p><div>foo</div></p>
```
Output a complete HTML document, including <html>, <head>, and <body> tags instead of an HTML fragment.
booleanfalse1.8.5Set custom ID for a heading.
!!! warning ""
This option can be overridden with the noHeaderId option.
booleanfalse1.7.0=== "code"
```html
## Sample heading {mycustomid}
```
=== "output"
```html
<h1 id="mycustomid">This is a heading</h1>
```
!!! hint ""
For better readability and human-friendliness of the heading IDs, it is also recommended to set the ghCompatibleHeaderId option to true.
Disable the rule of 4 spaces to indent sub-lists. If enabled, this option effectively reverts to the old behavior where you can indent sub-lists with 2 or 3 spaces.
booleanfalse1.5.0=== "input"
```
- one
- two
...
- one
- two
```
=== "output (value is false)"
```html
<ul>
<li>one</li>
<li>two</li>
</ul>
<p>...</p>
<ul>
<li>one
<ul>
<li>two</li>
</ul>
</li>
</ul>
```
=== "output (value is true)"
```html
<ul>
<li>one
<ul>
<li>two</li>
</ul>
</li>
</ul>
<p>...</p>
<ul>
<li>one
<ul>
<li>two</li>
</ul>
</li>
</ul>
```
Enable emoji support. For more info on available emojis, see https://github.com/showdownjs/showdown/wiki/Emojis (since v.1.8.0)
booleanfalse1.8.0=== "input"
```
this is a :smile: emoji
```
=== "output (value is false)"
```html
<p>this is a :smile: emoji</p>
```
=== "output (value is true)"
```html
<p>this is a 😄 emoji</p>
```
!!! hint "Full list of supported emojies"
Check the [Showdown Wiki](https://github.com/showdownjs/showdown/wiki/Emojis#emoji-list) for a full list of supported emojies.
Enable automatic obfuscation of email addresses. During this process, email addresses are encoded via Character Entities, transforming ASCII email addresses into their equivalent decimal entities.
booleanfalse1.6.1=== "input"
```
<[email protected]>
```
=== "output (value is false)"
```html
<a href="mailto:[email protected]">[email protected]</a>
```
=== "output (value is true)"
```html
<a href="mailto:myself@example.com">myself@example.com</a>
```
Exclude trailing punctuation from autolinked URLs: . ! ? ( )
This option applies only to links generated by simplifiedAutoLink.
booleanfalse1.5.1=== "input"
```
check this link www.google.com.
```
=== "output (value is false)"
```html
<p>check this link <a href="www.google.com">www.google.com.</a></p>
```
=== "output (value is true)"
```html
<p>check this link <a href="www.google.com">www.google.com</a>.</p>
```
Enable support for GFM code block style syntax (fenced codeblocks).
booleantrue0.3.1=== "example"
```
```
some code here
```
```
Generate heading IDs compatible with GitHub style: spaces are replaced with dashes, and certain non-alphanumeric chars are removed.
!!! warning ""
This option can be overridden with the noHeaderId option.
booleanfalse1.5.5=== "input"
```
# This is a heading with @#$%
```
=== "output (value is false)"
```html
<h1 id="thisisaheading">This is a heading</h1>
```
=== "output (value is true)"
```html
<h1 id="this-is-a-heading-with-">This is a heading with @#$%</h1>
```
Enables support for GitHub @mentions that allows you to link to the GitHub profile page of the mentioned username.
booleanfalse1.6.0=== "input"
```
hello there @tivie
```
=== "output (value is false)"
```html
<p>hello there @tivie</p>
```
=== "output (value is true)"
```html
<p>hello there <a href="https://www.github.com/tivie">@tivie</a></p>
```
Specify where the link generated by @mentions should point to. Works only when ghMentions: true.
booleanhttps://github.com/{u}1.6.2=== "input"
```
hello there @tivie
```
=== "output (value is https://github.com/{u})"
```html
<p>hello there <a href="https://www.github.com/tivie">@tivie</a></p>
```
=== "output (value is http://mysite.com/{u}/profile)"
```html
<p>hello there <a href="//mysite.com/tivie/profile">@tivie</a></p>
```
Set starting level for the heading tags.
integer11.1.0=== "input"
```
# This is a heading
```
=== "output (value is 1)"
```html
<h1>This is a heading</h1>
```
=== "output (value is 3)"
```html
<h3>This is a heading</h3>
```
Treat underscores in the middle of words as literal characters.
Underscores allow you to specify the words that should be emphasized. However, in some cases, this may be unwanted behavior. With this option enabled, underscores in the middle of words will no longer be interpreted as <em> and <strong>, but as literal underscores.
booleanfalse1.2.0=== "input"
```
some text with__underscores__in the middle
```
=== "output (value is false)"
```html
<p>some text with<strong>underscores</strong>in the middle</p>
```
=== "output (value is true)"
```html
<p>some text with__underscores__in the middle</p>
```
Enable support for document metadata (front-matter). You can define metadata at the top of a document between ««« »»» or --- --- symbols.
booleanfalse1.8.5=== "input"
```js
let ref = `referenced value`;
var markdown = `
---
first: Lorem
second: Ipsum
ref_variable: ${ref}
---
`
var conv = new showdown.Converter({metadata: true});
var html = conv.makeHtml(markdown);
var metadata = conv.getMetadata();
```
=== "output (value is true)"
```js
// console.log(metadata)
{
first: 'Lorem',
second: 'Ipsum',
ref_variable: 'referenced value'
}
```
Disable automatic generation of heading IDs.
!!! warning ""
Setting the option to true overrides the following options:
* [`prefixHeaderId`](#prefixheaderid)
* [`customizedHeaderId`](#customizedheaderid)
* [`ghCompatibleHeaderId`](#ghcompatibleheaderid)
booleanfalse1.1.0=== "input"
```
# This is a heading
```
=== "output (value is false)"
```html
<h1 id="thisisaheading">This is a heading</h1>
```
=== "output (value is true)"
```html
<h1>This is a heading</h1>
```
Omit trailing newline in code blocks (which is set by default before the closing tag). This option affects both indented and fenced (gfm style) code blocks.
booleanfalse1.0.0=== "input"
```
var foo = 'bar';
```
=== "output (value is false)"
```html
<code><pre>var foo = 'bar';
</pre></code>
```
=== "output (value is true)"
```html
<code><pre>var foo = 'bar';</pre></code>
```
Open links in new windows.
booleanfalse1.7.0=== "input"
```
[link](https://google.com)
```
=== "output (value is false)"
```html
<a href="https://google.com">link</a>
```
=== "output (value is true)"
```html
<a href="https://google.com" rel="noopener noreferrer" target="_blank">link</a>
```
Set image dimensions from within Markdown syntax.
booleanfalse1.1.0=== "example"
```
 set width to 100px and height to 80px
 set width to 100px and height to "auto"
 set width to 80% and height to 5em
```
Add a prefix to the generated heading ID:
true will add a generic section prefix.!!! warning ""
This option can be overridden with the noHeaderId option.
string / booleanfalse=== "input"
```
# This is a heading
```
=== "output (value is false)"
```html
<h1 id="thisisaheading">This is a heading</h1>
```
=== "output (value is true)"
```html
<h1 id="sectionthisisaheading">This is a heading</h1>
```
=== "output (value is showdown)"
```html
<h1 id="showdownthisisaheading">This is a heading</h1>
```
Replace (space), ' (single quote), and " (double quote) with - (dash) in the generated heading IDs, including prefixes.
!!! danger "" Use with caution as it might result in malformed IDs.
1.7.3Prevent Showndown from modifying the prefix. Works only when prefixHeaderId is set to a string value.
!!! danger ""
Use with caution as it might result in malformed IDs. For example, when the prefix contains special characters like " \ / or others.
booleanfalse1.7.3Require a space between a heading # and the heading text.
booleanfalse1.5.3=== "input"
```
#heading
```
=== "output (value is false)"
```html
<h1 id="heading">heading</h1>
```
=== "output (value is true)"
```html
<p>#heading</p>
```
Parse line breaks as in paragraphs (GitHub-style behavior).
booleanfalse1.5.1=== "input"
```
a line
wrapped in two
```
=== "output (value is false)"
```html
<p>a line
wrapped in two</p>
```
=== "output (value is true)"
```html
<p>a line
wrapped in two</p>
```
Enable automatic linking for plain text URLs.
booleanfalse1.2.0=== "input"
```
Lorem ipsum www.google.com
```
=== "output (value is false)"
```html
<p>Lorem ipsum www.google.com</p>
```
=== "output (value is true)"
```html
<p>Lorem ipsum <a href="www.google.com">www.google.com</a></p>
```
Resolve indentation problems related to ES6 template strings in the midst of indented code.
booleanfalse1.4.2Resolve an awkward effect when a paragraph is followed by a list. This effect appears on some circumstances, in live preview editors.
booleanfalse1.2.1!!! example "awkward effect"

Split adjacent blockquote blocks.
booleanfalse1.8.6=== "input"
```
> Quote #1
>> Sub-quote 1
> Quote #2
>> Sub-quote 2
```
=== "output (value is false)"
```html
<blockquote>
<p>Quote #1</p>
<blockquote>
<p>Sub-quote 1</p>
</blockquote>
<p>Quote #2</p>
<blockquote>
<p>Sub-quote 2</p>
</blockquote>
</blockquote>
```
=== "output (value is true)"
```html
<blockquote>
<p>Quote #1</p>
<blockquote>
<p>Sub-quote 1</p>
</blockquote>
</blockquote>
<blockquote>
<p>Quote #2</p>
<blockquote>
<p>Sub-quote 2</p>
</blockquote>
</blockquote>
```
Enable support for strikethrough (<del>).
booleanfalse1.2.0=== "input"
```
~~strikethrough~~
```
=== "output (value is true)"
```html
<del>strikethrough</del>
```
Enable support for tables syntax.
booleanfalse1.2.0=== "example"
```
| h1 | h2 | h3 |
|:------|:-------:|--------:|
| 100 | [a][1] | ![b][2] |
| *foo* | **bar** | ~~baz~~ |
```
Generate automatic IDs for table headings. Works only when tables: true.
booleanfalse1.2.0Enable support for GitHub style tasklists.
booleanfalse1.2.0=== "example"
```
- [x] This task is done
- [ ] This task is still pending
```
Enable support for underline. If enabled, underscores will no longer be parsed as <em> and <strong>.
booleanfalseExperimental=== "example"
```
__underlined word__ // double underscores
___underlined word___ // triple underscores
```