Skip to content

Showdown options

You can change Showdown's default behavior via options.

Set option


Setting an option globally affects all Showdown instances.

showdown.setOption('optionKey', 'value');


Setting an option locally affects the specified Converter object only. You can set local options via:

var converter = new showdown.Converter({optionKey: 'value'});
var converter = new showdown.Converter();
converter.setOption('optionKey', 'value');

Get option

Showdown provides both local and global methods to retrieve previously set options:

// Global
var myOption = showdown.getOption('optionKey');

var myOption = converter.getOption('optionKey');
// Global
var showdownGlobalOptions = showdown.getOptions();

var thisConverterSpecificOptions = converter.getOptions();

Get default options

You can get Showdown's default options with:

var defaultOptions = showdown.getDefaultOptions();