feat(showdown.getDefaultOptions): add method to retrieve default global options key->values

Showdown default options are now retrievable through `showdown.getDefaultOptions()` function
This commit is contained in:
Estevão Soares dos Santos 2015-06-15 14:49:26 +01:00
parent 27ed758d7b
commit 2de53a7d03

View File

@ -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
*