Skip to content

Showdown Options

Estevão Soares dos Santos edited this page Feb 6, 2017 · 8 revisions

To learn how to set and get options, please check Showdown's API documentation

omitExtraWLInCodeBlocks

type default description
boolean false Omit the trailing newline in a code block

By default, showdown adds a newline before the closing tags in code blocks. By enabling this option, that newline is removed.
This option affects both indented and fenced (gfm style) code blocks.

Example:

input:

    var foo = 'bar';

omitExtraWLInCodeBlocks = false:

<code><pre>var foo = 'bar';
</pre></code>

omitExtraWLInCodeBlocks = true:

<code><pre>var foo = 'bar';</pre></code>