!!! warning "" Starting from the version `1.6.0` and earlier, all the options are `disabled` by default in the cli tool. ### backslashEscapesHTMLTags Support escaping of HTML tags. * type: `boolean` * default value: `false` * introduced in: `1.7.2` === "input" ```html \
<div>foo</div>
``` ### completeHTMLDocument Output a complete HTML document, including ``, ``, and `` tags instead of an HTML fragment. * type: `boolean` * default value: `false` * introduced in: `1.8.5` ### customizedHeaderId Set custom ID for a heading. !!! warning "" This option can be overridden with the [`noHeaderId`](#noheaderid) option. * type: `boolean` * default value: `false` * introduced in: `1.7.0` === "code" ```html ## Sample heading {mycustomid} ``` === "output" ```html...
...
this is a :smile: emoji
``` === "output (value is `true`)" ```htmlthis is a 😄 emoji
``` !!! 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. ### encodeEmails 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. * type: `boolean` * default value: `false` * introduced in: `1.6.1` === "input" ```check this link www.google.com.
``` === "output (value is `true`)" ```htmlcheck this link www.google.com.
``` ### ghCodeBlocks Enable support for GFM code block style syntax (fenced codeblocks). * type: `boolean` * default value: `true` * introduced in: `0.3.1` === "example" ``` ``` some code here ``` ``` ### ghCompatibleHeaderId 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`](#noheaderid) option. * type: `boolean` * default value: `false` * introduced in: `1.5.5` === "input" ``` # This is a heading with @#$% ``` === "output (value is `false`)" ```htmlhello there @tivie
``` === "output (value is `true`)" ```htmlhello there @tivie
``` ### ghMentionsLink Specify where the link generated by `@mentions` should point to. Works only when [`ghMentions: true`](#ghmentions). * type: `boolean` * default value: `https://github.com/{u}` * introduced in: `1.6.2` === "input" ``` hello there @tivie ``` === "output (value is `https://github.com/{u}`)" ```htmlhello there @tivie
``` === "output (value is `http://mysite.com/{u}/profile`)" ```htmlhello there @tivie
``` ### headerLevelStart Set starting level for the heading tags. * type: `integer` * default value: `1` * introduced in: `1.1.0` === "input" ``` # This is a heading ``` === "output (value is `1`)" ```htmlsome text withunderscoresin the middle
``` === "output (value is `true`)" ```htmlsome text with__underscores__in the middle
``` ### metadata Enable support for document metadata (front-matter). You can define metadata at the top of a document between `««« »»»` or `--- ---` symbols. * type: `boolean` * default value: `false` * introduced in: `1.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' } ``` ### noHeaderId Disable automatic generation of heading IDs. !!! warning "" Setting the option to `true` overrides the following options: * [`prefixHeaderId`](#prefixheaderid) * [`customizedHeaderId`](#customizedheaderid) * [`ghCompatibleHeaderId`](#ghcompatibleheaderid) * type: `boolean` * default value: `false` * introduced in: `1.1.0` === "input" ``` # This is a heading ``` === "output (value is `false`)" ```htmlvar foo = 'bar';
```
=== "output (value is `true`)"
```html
var foo = 'bar';
```
### openLinksInNewWindow
Open links in new windows.
* type: `boolean`
* default value: `false`
* introduced in: `1.7.0`
=== "input"
```
[link](https://google.com)
```
=== "output (value is `false`)"
```html
link
```
=== "output (value is `true`)"
```html
link
```
### parseImgDimensions
Set image dimensions from within Markdown syntax.
* type: `boolean`
* default value: `false`
* introduced in: `1.1.0`
=== "example"
```
![foo](foo.jpg =100x80) set width to 100px and height to 80px
![bar](bar.jpg =100x*) set width to 100px and height to "auto"
![baz](baz.jpg =80%x5em) set width to 80% and height to 5em
```
### prefixHeaderId
Add a prefix to the generated heading ID:
* Passing a string will add that string to the heading ID.
* Passing `true` will add a generic `section` prefix.
!!! warning ""
This option can be overridden with the [`noHeaderId`](#noheaderid) option.
* type: `string / boolean`
* default value: `false`
=== "input"
```
# This is a heading
```
=== "output (value is `false`)"
```html
#heading
``` ### simpleLineBreaks Parse line breaks as `a line wrapped in two
``` === "output (value is `true`)" ```htmla line
wrapped in two
Lorem ipsum www.google.com
``` === "output (value is `true`)" ```htmlLorem ipsum www.google.com
``` ### smartIndentationFix Resolve indentation problems related to ES6 template strings in the midst of indented code. * type: `boolean` * default value: `false` * introduced in: `1.4.2` ### smoothLivePreview Resolve an awkward effect when a paragraph is followed by a list. This effect appears on some circumstances, in live preview editors. * type: `boolean` * default value: `false` * introduced in: `1.2.1` !!! example "awkward effect" ![](http://i.imgur.com/YQ9iHTL.gif​) ### splitAdjacentBlockquotes Split adjacent blockquote blocks. * type: `boolean` * default value: `false` * introduced in: `1.8.6` === "input" ``` > Quote #1 >> Sub-quote 1 > Quote #2 >> Sub-quote 2 ``` === "output (value is `false`)" ```html``` === "output (value is `true`)" ```htmlQuote #1
Sub-quote 1
Quote #2
Sub-quote 2
Quote #1
Sub-quote 1
``` ### strikethrough Enable support for strikethrough (`Quote #2
Sub-quote 2