Skip to content

Commit

Permalink
feat(showdown.getDefaultOptions): add method to retrieve default glob…
Browse files Browse the repository at this point in the history
…al options key->values

Showdown default options are now retrievable through `showdown.getDefaultOptions()` function
  • Loading branch information
tivie committed Jun 15, 2015
1 parent 27ed758 commit 2de53a7
Showing 1 changed file with 15 additions and 1 deletion.
16 changes: 15 additions & 1 deletion src/showdown.js
Original file line number Diff line number Diff line change
Expand Up @@ -52,18 +52,32 @@ showdown.getOption = function (key) {
/**
* Get the global options
* @static
* @returns {{omitExtraWLInCodeBlocks: boolean, prefixHeaderId: boolean}}
* @returns {{}}
*/
showdown.getOptions = function () {
'use strict';
return globalOptions;
};

/**
* Reset global options to the default values
* @static
*/
showdown.resetOptions = function () {
'use strict';
globalOptions = JSON.parse(JSON.stringify(defaultOptions));
};

/**
* Get the default options
* @static
* @returns {{}}
*/
showdown.getDefaultOptions = function () {
'use strict';
return defaultOptions;
};

/**
* Get or set a subParser
*
Expand Down

0 comments on commit 2de53a7

Please sign in to comment.